123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407 |
- ;=====================================================================o
- ; Feng Ruohang's AHK Script |
- ; CapsLock Enhancement |
- ;---------------------------------------------------------------------o
- ;Description: |
- ; This Script is wrote by Feng Ruohang via AutoHotKey Script. It |
- ; Provieds an enhancement towards the "Useless Key" CapsLock, and |
- ; turns CapsLock into an useful function Key just like Ctrl and Alt |
- ; by combining CapsLock with almost all other keys in the keyboard. |
- ; |
- ;Summary: |
- ;o----------------------o---------------------------------------------o
- ;|CapsLock; | {ESC} Especially Convient for vim user |
- ;|CaspLock + ` | {CapsLock}CapsLock Switcher as a Substituent|
- ;|CapsLock + hjklwb | Vim-Style Cursor Mover |
- ;|CaspLock + uiop | Convient Home/End PageUp/PageDn |
- ;|CaspLock + nm,. | Convient Delete Controller |
- ;|CapsLock + zxcvay | Windows-Style Editor |
- ;|CapsLock + Direction | Mouse Move |
- ;|CapsLock + Enter | Mouse Click |
- ;|CaspLock + {F1}~{F6} | Media Volume Controller |
- ;|CapsLock + qs | Windows & Tags Control |
- ;|CapsLock + ;'[] | Convient Key Mapping |
- ;|CaspLock + dfert | Frequently Used Programs (Self Defined) |
- ;|CaspLock + 123456 | Dev-Hotkey for Visual Studio (Self Defined) |
- ;|CapsLock + 67890-= | Shifter as Shift |
- ;-----------------------o---------------------------------------------o
- ;|Use it whatever and wherever you like. Hope it help |
- ;=====================================================================o
- ;=====================================================================o
- ; CapsLock Initializer ;|
- ;---------------------------------------------------------------------o
- SetCapsLockState, AlwaysOff ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Switcher: ;|
- ;---------------------------------o-----------------------------------o
- ; CapsLock + ` | {CapsLock} ;|
- ;---------------------------------o-----------------------------------o
- CapsLock & `:: ;|
- GetKeyState, CapsLockState, CapsLock, T ;|
- if CapsLockState = D ;|
- SetCapsLockState, AlwaysOff ;|
- else ;|
- SetCapsLockState, AlwaysOn ;|
- KeyWait, `` ;|
- return ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Escaper: ;|
- ;----------------------------------o----------------------------------o
- ; CapsLock | {ESC} ;|
- ;----------------------------------o----------------------------------o
- CapsLock::Send, {ESC} ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Direction Navigator ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + h | Left ;|
- ; CapsLock + j | Down ;|
- ; CapsLock + k | Up ;|
- ; CapsLock + l | Right ;|
- ; Ctrl, Alt Compatible ;|
- ;-----------------------------------o---------------------------------o
- CapsLock & h:: ;|
- if GetKeyState("control") = 0 ;|
- { ;|
- if GetKeyState("alt") = 0 ;|
- Send, {Left} ;|
- else ;|
- Send, +{Left} ;|
- return ;|
- } ;|
- else { ;|
- if GetKeyState("alt") = 0 ;|
- Send, ^{Left} ;|
- else ;|
- Send, +^{Left} ;|
- return ;|
- } ;|
- return ;|
- ;-----------------------------------o ;|
- CapsLock & j:: ;|
- if GetKeyState("control") = 0 ;|
- { ;|
- if GetKeyState("alt") = 0 ;|
- Send, {Down} ;|
- else ;|
- Send, +{Down} ;|
- return ;|
- } ;|
- else { ;|
- if GetKeyState("alt") = 0 ;|
- Send, ^{Down} ;|
- else ;|
- Send, +^{Down} ;|
- return ;|
- } ;|
- return ;|
- ;-----------------------------------o ;|
- CapsLock & k:: ;|
- if GetKeyState("control") = 0 ;|
- { ;|
- if GetKeyState("alt") = 0 ;|
- Send, {Up} ;|
- else ;|
- Send, +{Up} ;|
- return ;|
- } ;|
- else { ;|
- if GetKeyState("alt") = 0 ;|
- Send, ^{Up} ;|
- else ;|
- Send, +^{Up} ;|
- return ;|
- } ;|
- return ;|
- ;-----------------------------------o ;|
- CapsLock & l:: ;|
- if GetKeyState("control") = 0 ;|
- { ;|
- if GetKeyState("alt") = 0 ;|
- Send, {Right} ;|
- else ;|
- Send, +{Right} ;|
- return ;|
- } ;|
- else { ;|
- if GetKeyState("alt") = 0 ;|
- Send, ^{Right} ;|
- else ;|
- Send, +^{Right} ;|
- return ;|
- } ;|
- return ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Home/End Navigator ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + i | Home ;|
- ; CapsLock + o | End ;|
- ; Ctrl, Alt Compatible ;|
- ;-----------------------------------o---------------------------------o
- CapsLock & i:: ;|
- if GetKeyState("control") = 0 ;|
- { ;|
- if GetKeyState("alt") = 0 ;|
- Send, {Home} ;|
- else ;|
- Send, +{Home} ;|
- return ;|
- } ;|
- else { ;|
- if GetKeyState("alt") = 0 ;|
- Send, ^{Home} ;|
- else ;|
- Send, +^{Home} ;|
- return ;|
- } ;|
- return ;|
- ;-----------------------------------o ;|
- CapsLock & o:: ;|
- if GetKeyState("control") = 0 ;|
- { ;|
- if GetKeyState("alt") = 0 ;|
- Send, {End} ;|
- else ;|
- Send, +{End} ;|
- return ;|
- } ;|
- else { ;|
- if GetKeyState("alt") = 0 ;|
- Send, ^{End} ;|
- else ;|
- Send, +^{End} ;|
- return ;|
- } ;|
- return ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Page Navigator ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + u | PageUp ;|
- ; CapsLock + p | PageDown ;|
- ; Ctrl, Alt Compatible ;|
- ;-----------------------------------o---------------------------------o
- CapsLock & u:: ;|
- if GetKeyState("control") = 0 ;|
- { ;|
- if GetKeyState("alt") = 0 ;|
- Send, {PgUp} ;|
- else ;|
- Send, +{PgUp} ;|
- return ;|
- } ;|
- else { ;|
- if GetKeyState("alt") = 0 ;|
- Send, ^{PgUp} ;|
- else ;|
- Send, +^{PgUp} ;|
- return ;|
- } ;|
- return ;|
- ;-----------------------------------o ;|
- CapsLock & p:: ;|
- if GetKeyState("control") = 0 ;|
- { ;|
- if GetKeyState("alt") = 0 ;|
- Send, {PgDn} ;|
- else ;|
- Send, +{PgDn} ;|
- return ;|
- } ;|
- else { ;|
- if GetKeyState("alt") = 0 ;|
- Send, ^{PgDn} ;|
- else ;|
- Send, +^{PgDn} ;|
- return ;|
- } ;|
- return ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Mouse Controller ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + Up | Mouse Up ;|
- ; CapsLock + Down | Mouse Down ;|
- ; CapsLock + Left | Mouse Left ;|
- ; CapsLock + Right | Mouse Right ;|
- ; CapsLock + Enter(Push Release) | Mouse Left Push(Release) ;|
- ;-----------------------------------o---------------------------------o
- CapsLock & Up:: MouseMove, 0, -10, 0, R ;|
- CapsLock & Down:: MouseMove, 0, 10, 0, R ;|
- CapsLock & Left:: MouseMove, -10, 0, 0, R ;|
- CapsLock & Right:: MouseMove, 10, 0, 0, R ;|
- ;-----------------------------------o ;|
- CapsLock & Enter:: ;|
- SendEvent {Blind}{LButton down} ;|
- KeyWait Enter ;|
- SendEvent {Blind}{LButton up} ;|
- return ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Deletor ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + n | Ctrl + Delete (Delete a Word) ;|
- ; CapsLock + m | Delete ;|
- ; CapsLock + , | BackSpace ;|
- ; CapsLock + . | Ctrl + BackSpace ;|
- ;-----------------------------------o---------------------------------o
- CapsLock & ,:: Send, {Del} ;|
- CapsLock & .:: Send, ^{Del} ;|
- CapsLock & m:: Send, {BS} ;|
- CapsLock & n:: Send, ^{BS} ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Editor ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + z | Ctrl + z (Cancel) ;|
- ; CapsLock + x | Ctrl + x (Cut) ;|
- ; CapsLock + c | Ctrl + c (Copy) ;|
- ; CapsLock + v | Ctrl + z (Paste) ;|
- ; CapsLock + a | Ctrl + a (Select All) ;|
- ; CapsLock + y | Ctrl + z (Yeild) ;|
- ; CapsLock + w | Ctrl + Right(Move as [vim: w]);|
- ; CapsLock + b | Ctrl + Left (Move as [vim: b]);|
- ;-----------------------------------o---------------------------------o
- CapsLock & z:: Send, ^z ;|
- CapsLock & x:: Send, ^x ;|
- CapsLock & c:: Send, ^c ;|
- CapsLock & v:: Send, ^v ;|
- CapsLock & a:: Send, ^a ;|
- CapsLock & y:: Send, ^y ;|
- CapsLock & w:: Send, ^{Right} ;|
- CapsLock & b:: Send, ^{Left} ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Media Controller ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + F1 | Volume_Mute ;|
- ; CapsLock + F2 | Volume_Down ;|
- ; CapsLock + F3 | Volume_Up ;|
- ; CapsLock + F3 | Media_Play_Pause ;|
- ; CapsLock + F5 | Media_Next ;|
- ; CapsLock + F6 | Media_Stop ;|
- ;-----------------------------------o---------------------------------o
- CapsLock & F1:: Send, {Volume_Mute} ;|
- CapsLock & F2:: Send, {Volume_Down} ;|
- CapsLock & F3:: Send, {Volume_Up} ;|
- CapsLock & F4:: Send, {Media_Play_Pause} ;|
- CapsLock & F5:: Send, {Media_Next} ;|
- CapsLock & F6:: Send, {Media_Stop} ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Window Controller ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + s | Ctrl + Tab (Swith Tag) ;|
- ; CapsLock + q | Ctrl + W (Close Tag) ;|
- ; (Disabled) Alt + CapsLock + s | AltTab (Switch Windows) ;|
- ; Alt + CapsLock + q | Ctrl + Tab (Close Windows) ;|
- ; CapsLock + g | AppsKey (Menu Key) ;|
- ;-----------------------------------o---------------------------------o
- CapsLock & s::Send, ^{Tab} ;|
- ;-----------------------------------o ;|
- CapsLock & q:: ;|
- if GetKeyState("alt") = 0 ;|
- { ;|
- Send, ^w ;|
- } ;|
- else { ;|
- Send, !{F4} ;|
- return ;|
- } ;|
- return ;|
- ;-----------------------------------o ;|
- CapsLock & g:: Send, {AppsKey} ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Self Defined Area ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + d | Alt + d(Dictionary) ;|
- ; CapsLock + f | Alt + f(Search via Everything);|
- ; CapsLock + e | Open Search Engine ;|
- ; CapsLock + r | Open Shell ;|
- ; CapsLock + t | Open Text Editor ;|
- ;-----------------------------------o---------------------------------o
- CapsLock & d:: Send, !d ;|
- CapsLock & f:: Send, !f ;|
- CapsLock & e:: Run http://cn.bing.com/ ;|
- CapsLock & r:: Run cmder ;|
- CapsLock & t:: Run C:\Program Files (x86)\Notepad++\notepad++.exe ;|
- ;---------------------------------------------------------------------o
- ;=====================================================================o
- ; CapsLock Char Mapping ;|
- ;-----------------------------------o---------------------------------o
- ; CapsLock + ; | Enter (Cancel) ;|
- ; CapsLock + ' | = ;|
- ; CapsLock + [ | Back (Visual Studio) ;|
- ; CapsLock + ] | Goto Define (Visual Studio) ;|
- ; CapsLock + / | Comment (Visual Studio) ;|
- ; CapsLock + \ | Uncomment (Visual Studio) ;|
- ; CapsLock + 1 | Build and Run(Visual Studio) ;|
- ; CapsLock + 2 | Debuging (Visual Studio) ;|
- ; CapsLock + 3 | Step Over (Visual Studio) ;|
- ; CapsLock + 4 | Step In (Visual Studio) ;|
- ; CapsLock + 5 | Stop Debuging(Visual Studio) ;|
- ; CapsLock + 6 | Shift + 6 ^ ;|
- ; CapsLock + 7 | Shift + 7 & ;|
- ; CapsLock + 8 | Shift + 8 * ;|
- ; CapsLock + 9 | Shift + 9 ( ;|
- ; CapsLock + 0 | Shift + 0 ) ;|
- ;-----------------------------------o---------------------------------o
- CapsLock & `;:: Send, {Enter} ;|
- CapsLock & ':: Send, = ;|
- CapsLock & [:: Send, ^- ;|
- CapsLock & ]:: Send, {F12} ;|
- ;-----------------------------------o ;|
- CapsLock & /:: ;|
- Send, ^e ;|
- Send, c ;|
- return ;|
- ;-----------------------------------o ;|
- CapsLock & \:: ;|
- Send, ^e ;|
- Send, u ;|
- return ;|
- ;-----------------------------------o ;|
- CapsLock & 1:: Send,^{F5} ;|
- CapsLock & 2:: Send,{F5} ;|
- CapsLock & 3:: Send,{F10} ;|
- CapsLock & 4:: Send,{F11} ;|
- CapsLock & 5:: Send,+{F5} ;|
- ;-----------------------------------o ;|
- CapsLock & 6:: Send,+6 ;|
- CapsLock & 7:: Send,+7 ;|
- CapsLock & 8:: Send,+8 ;|
- CapsLock & 9:: Send,+9 ;|
- CapsLock & 0:: Send,+0 ;|
- ;---------------------------------------------------------------------o
|