; 2009-06-13, ..., 2010-11-14 ; Xah Lee's autohotkey set ; See: ; http://xahlee.org/mswin/autohotkey.html ; http://xahlee.org/mswin/autohotkey_key_notations.html ; # Win ; ^ Ctrl ; ! Alt ; + Shift ;-------------------------------------------------- ;;; global ahk script settings #SingleInstance force DetectHiddenWindows, on SetTitleMatchMode, 2 SetNumLockState, on SetCapsLockState, off $CapsLock::Return ;-------------------------------------------------- ; turn on system wide ErgoEmacs keybinding ; Run "c:/Users/xah/ErgoEmacs_Source/ergoemacs/extra/ErgoEmacs_keybinding_Windows_dvorak.ahk" ; ;-------------------------------------------------- ; ; make the forward and backward buttons do copy and paste ; XButton2::Send ^c ;-------------------------------------------------- ; global hotkeys ;; disable Win key behavior of popping up the Start Menu. Make it send Return. ~LWin Up::Return ; ~RWin Up::Return ;; make the right Win key behave as AppsKey RWin::AppsKey ;; toggle on/off hotkeys of this script. $+ScrollLock::Suspend ; reload this script (Shift+ScrLk) $!ScrollLock::reload ; switch to last app $NumpadAdd::Send !{Tab} ;;; increase/decrease sound level $^)::Send {Volume_Up 5} $^(::Send {Volume_Down 5} $NumLock::Return ;;; toggle window maximize/restore windowMaxed := false $ScrollLock:: If windowMaxed { WinRestore, A windowMaxed := false } Else { WinMaximize, A windowMaxed := true } Return ; ; minimize window ; $!+NumLock::WinMinimize, A ; disable minimizing window #m::Send {Return} #+m::Send {Return} ; disable putting the focus on the Taskbar #t::Return ; going into desktop. Windows's default behavior is annoying because it hides all other apps. $#d::Run "C:\Users\xah\Documents\autohotkey\launch xah desktop.ahk" ; disable the bunch of launch app keys setup by QuickLaunch. Because it change keys whenever you add or delete a icon there. #1::Return #2::Return ; #3::Return #4::Return #5::Return #6::Return #7::Run "launch or switch skype.ahk" #8::Return #9::Return #0::Return ; Ctrl+Shift and right hand for numbers ; $^+b::Send 0 ; $^+m::Send 1 ; $^+w::Send 2 ; $^+v::Send 3 ; $^+h::Send 4 ; $^+t::Send 5 ; $^+n::Send 6 ; $^+g::Send 7 ; $^+c::Send 8 ; $^+r::Send 9 $F1::Run "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" $F2::Send ^c $F3::Send ^v $F4::Run "C:\Users\xah\Documents\autohotkey\launch or switch google chrome.ahk" $F6::Run "C:\Users\xah\Documents\autohotkey\launch or switch emacs.ahk" $F7::Run "C:\Users\xah\Documents\autohotkey\launch or switch firefox.ahk" $F9::Run "C:\Users\xah\Documents\autohotkey\launch or switch internet explorer.ahk" $F10::Run "C:\Users\xah\Documents\autohotkey\launch or switch PowerShell.ahk" ;;; iTunes ;; next song $NumpadSub:: IfWinExist, ahk_class iTunes ControlSend, ahk_parent, ^{Right} Return ;; prev song $^NumpadSub:: IfWinExist, ahk_class iTunes ControlSend, ahk_parent, ^{Left} Return ;-------------------------------------------------- ;; Windows Explorer hotkeys #IfWinActive ahk_class CabinetWClass ; Set view style to “detail” $Numpad1::Send {Alt}vd ; Set view style to “medium icons” $Numpad2::Send {Alt}vm ; Set view style to “large icons” $Numpad3::Send {Alt}vr {Enter} ;-------------------------------------------------- ;; IrfanView hotkeys #IfWinActive ahk_class IrfanView ; close image $Pause::Send {Esc} ; switch random img. $Numpad0::Send ^m ;-------------------------------------------------- ;; VLC hotkeys #IfWinActive ahk_class QWidget ; close image $Pause::Send !{F4} ;-------------------------------------------------- ;; Notepad hotkeys #IfWinActive ahk_class Notepad ; close window $Pause::Send !{F4} ;-------------------------------------------------- ;; Mathematica hotkeys #IfWinActive ahk_class NotebookFrame ; close window $Pause::Send ^w ;-------------------------------------------------- ;; IrfanView full screen hotkeys ; switch random img. #IfWinActive ahk_class FullScreenClass $Numpad0::Send ^m ;-------------------------------------------------- ;; Second Life hotkeys ; Emerald Viewer 1.4.0.2439 ; ahk_class Second Life ; Imprudence ; ahk_class Imprudence ; GroupAdd, SecondLife ; if WinActive("ahk_class Second Life") or WinActive("ahk_class Imprudence") ; ; zoom normal ; $NumpadEnter::Send ^9 ; zoom toggle zoomResetQ := false $Numpad7:: If zoomResetQ { Send ^0 Send ^0 Send ^0 zoomResetQ := false } Else { Send ^9 zoomResetQ := true } Return ; toggle mouse look $\::Send m ; reload ; grenade ; rocket ; melee ; zoom in ; zoom norm #IfWinActive ahk_class Second Life ; Insert sends itself $Insert::Send {Insert} ; close window $Pause::Send ^w ; combat setup $^Numpad9::Run "C:\Users\xah\Documents\autohotkey\Second Life combat setup.ahk" ; show hide volume (objects) $XButton1::Send ^!+9 ; show hide wireframe $XButton2::Send ^+r ; previous tab $NumpadDiv::Send !{Left} ; next tab $NumpadMult::Send !{Right} $Numpad1::Send ^!+9 ; show hide volume (objects) $Numpad3::Send ^!+= ; show/hide particles $Numpad4::Send ^+r ; show hide wireframe $Numpad5::Send ^+f ; show/hide friend list $Numpad6::Send ^!t ; show/hide alpha (transparent) objects $Numpad8::Send ^h ; show/hide local chat $Numpad9::Send ^+a ; Emerald toggle sim radar; or who's nearby ; ; zoom normal ; $NumpadEnter::Send ^9 ; zoom toggle zoomResetQ := false $Numpad7:: If zoomResetQ { Send ^0 Send ^0 Send ^0 zoomResetQ := false } Else { Send ^9 zoomResetQ := true } Return $F11::Send ^t ; toggle im $F12::Send ^i ; show/hide inventory $\::Send m ; toggle mouse look ;-------------------------------------------------- ;; emacs hotkeys #IfWinActive ahk_class Emacs $CapsLock::Send !a ; call execute-extended-command ; $^!F11::Send ^!{F11} ; $^!F12::Send ^!{F12} ; previous tab $NumpadDiv::Send ^{PgUp} ; next tab $NumpadMult::Send ^{PgDn} ; kill current buffer $Pause::Send ^w ; copy, in ergoemacs keybinding with dvorak layout $F2::Send !j ; paste, in ergoemacs keybinding with dvorak layout $F3::Send !k ;-------------------------------------------------- ;; firefox hotkeys #IfWinActive ahk_class MozillaUIWindowClass ; previous tab $NumpadDiv::Send ^{PgUp} ; next tab $NumpadMult::Send ^{PgDn} ; close window $Pause::Send ^w $^F12:: { Send ^t sleep 100 Send ^v sleep 100 Send {Enter} } Return ;-------------------------------------------------- ;; pidgin #IfWinActive ahk_class gdkWindowToplevel ; previous tab $NumpadDiv::Send ^{PgUp} ; next tab $NumpadMult::Send ^{PgDn} ;-------------------------------------------------- ;; Opera hotkeys #IfWinActive ahk_class OperaWindowClass ; close window $Pause::Send ^w ; previous tab $NumpadDiv::Send ^+{F6} ; next tab $NumpadMult::Send ^{F6} ; open new tab and paste in url, go there $^F12:: { Send ^t sleep 100 Send ^v sleep 100 Send {Enter} } Return ;-------------------------------------------------- ;; safari hotkeys #IfWinActive ahk_class {1C03B488-D53B-4a81-97F8-754559640193} ; previous tab $NumpadDiv::Send ^+{Tab} ; next tab $NumpadMult::Send ^{Tab} ; close window $Pause::Send ^w $^F12:: { Send ^t sleep 100 Send !d sleep 100 Send ^v sleep 100 Send {Enter} } Return ;-------------------------------------------------- ;; Windows Internet Explorer hotkeys #IfWinActive ahk_class IEFrame ; previous tab $NumpadDiv::Send ^+{Tab} ; next tab $NumpadMult::Send ^{Tab} ; close window $Pause::Send ^w $^F12:: { Send ^t sleep 100 Send ^v sleep 100 Send {Enter} } Return ; put focus on url field $^l::Send !d ;-------------------------------------------------- ;; google chrome hotkeys #IfWinActive ahk_class Chrome_WidgetWin_0 ; previous tab $NumpadDiv::Send ^{PgUp} ; next tab $NumpadMult::Send ^{PgDn} ; close window $Pause::Send ^w $^F12:: { Send ^t sleep 100 Send ^v sleep 100 Send {Enter} } Return ;-------------------------------------------------- ;; skype hotkeys #IfWinActive ahk_class TConversationForm.UnicodeClass ; close window $Pause::Send {Esc} ;-------------------------------------------------- ;; pidgin hotkeys #IfWinActive ahk_class gdkWindowToplevel ; close window $Pause::Send ^w ;-------------------------------------------------- ;; Windows Explorer hotkeys #IfWinActive ahk_class CabinetWClass ; close window $Pause::Send ^w ;-------------------------------------------------- ;; Windows Live Mail open window hotkeys #IfWinActive ahk_class ATH_Note ; close window $Pause::Send !{F4} ;-------------------------------------------------- ; on 2010-02-01, google chrome's class ; changed “Chrome_WidgetWin_0” to “Chrome_WindowImpl_0” ; 4.0.249.78 (36714) ; on 2010-05-26, it's back to Chrome_WidgetWin_0