 #NoEnv
 #SingleInstance, force
 SendMode Input
+DetectHiddenWindows, on
 
 
-;-- win+alt+up  => 增大音量
-#!up:: 
+
+;============= 自定义功能
+;---- win+esc， 暂存最小化当前窗口
+lastTitle=0
+#Esc::
+    if ( lastTitle!=0 ){
+        ;msgbox , lastTitle !=0 , %lastTitle%  
+        WinActivate, %lastTitle%   
+        lastTitle=0
+    }
+    else { 
+        WinGetActiveTitle , nowTitle
+        WinMinimize, %nowTitle% 
+        lastTitle = %nowTitle%    
+        ;msgbox , nowTitle = %nowTitle% ,  lastTitle = %lastTitle%
+
+    }
+return
+
+
+;==================== 系统音量
+;-- ctrl+win+up  => 增大音量
+^#up:: 
     SoundSet, +3
     SoundGet, master_volume
     Transform, master_volume, Round, master_volume
     TrayTip, volume, %master_volume%, , 1
 Return
 
-
-;-- win+alt+up  => 降低音量
-#!down:: 
+;-- ctrl+win+up  => 降低音量
+^#down:: 
     SoundSet, -3
     SoundGet, master_volume
     Transform, master_volume, Round, master_volume




;-- 无论何时何地用 gl+空格/回车 => 弹出link list，快速选择去哪里
::gl::
    Run, ruby C:\git\st\codecraft.git\ruby\projects\windows_start_helper\windows_start_helper.rb    
return


;-- 无论何时何地用 subl+空格/回车 => 打开sublime
::subl::
    Run, C:\Program Files\Sublime Text 2\sublime_text.exe   
return


Return



;==================== evernote 相关
;-- ctrl+alt+e  => 呼叫evernote 并搜索
^#e::
    IfWinNotExist ahk_class ENMainFrame
    {
        Run evernote        
        WinActivate
        WinWaitActive ahk_class ENMainFrame
        Send, ^!e
    }    
    IfWinNotActive ahk_class ENMainFrame
    {
        WinActivate
        WinWaitActive ahk_class ENMainFrame
        Send, ^!e
    }
    else
    {
        WinWaitActive ahk_class ENMainFrame
        Send, ^!e   
    }
Return

;-- ctrl+alt+n  => 呼叫evernote 并新建一个页面
^#n::
    IfWinNotExist ahk_class ENMainFrame
    {
        Run evernote       
        Send, ^!n
    }    
    else
    {
        Send, ^!n   
    }
Return



;-- CTRL+SHIFT+U => 在evernote里时，转化成无序列表
^+U::
    IfWinActive ahk_class ENMainFrame
    {
        Send , ^+B
    }
    IfWinActive ahk_class ENSingleNoteView
    {
        Send , ^+B    
    }
return


;-- CTRL+SHIFT+I => 在evernote里时，转化成有序列表
^+I::
    IfWinActive ahk_class ENMainFrame
    {        
        Send , ^+O
    }
    IfWinActive ahk_class ENSingleNoteView
    {        
        Send , ^+O    
    }
return





