
关于ahk语言请百度,这里只是记录常用改键代码。
AHK按键参考表
鼠标
概述tt
LButton 鼠标左键
RButton 鼠标右键
MButton 鼠标中键或滚轮
高级
XButton1 鼠标的第四个按钮 一般和 Browser_Back 执行相同功能
XButton2 鼠标的第五个按钮 一般和 Browser_Forward 执行相同功能
Wheel
WheelDown 向下转动鼠标滚轮(向您的方向)
WheelUp 向上转动鼠标滚轮(远离您的方向)
WheelLeft
WheelRight 向左或向右滚动 需要 Windows Vista 或更高版本 这可以用在某些(但并非所有)带第二个滚轮或支持左右滚动的鼠标热键
注意: 字母和数字按键的名称和单个字母或数字相同. 例如: b 表示 “b” 键而 5 表示 “5” 键.
CapsLock 大小写锁定键 Space 空格键 Tab Tab 键 Enter (或 Return) 回车键 Escape (或 Esc) 退出键 Backspace (或 BS) 退格键
ScrollLock 滚动锁定键 Delete (或 Del) 删除键 Insert (或 Ins) 插入改写切换键 Home Home 键 End End 键 PgUp 向上翻页键 PgDn 向下翻页键 Up 向上方向键 Down 向下方向键 Left 向左方向键 Right 向右方向键
F1 - F24 在大多数键盘顶部的 12 个或更多的功能键
按键修饰符
LWin 左边的 Windows 徽标键 对应的热键前缀为 <#
RWin 右边的 Windows 徽标键 对应的热键前缀为 >#
注意:与 Control/Alt/Shift 不同,没有一般的/中性的”Win”键,因为操作系统不支持 不过含 # 修饰符的热键可以被任何一个 Win 键触发
Control ^
Alt !
Shift +
LControl(或 LCtrl) <^
RControl(或 RCtrl) >^
LShift 左 Shift 键 对应的热键前缀为 <+
RShift 右 Shift 键 对应的热键前缀为 >+
LAlt 左 Alt 键 对应的热键前缀为 <!
RAlt 右 Alt 键 对应的热键前缀为 >!
Browser_Back 后退
Browser_Forward 前进
Browser_Refresh 刷新
Browser_Stop 停止
Browser_Search 搜索
Browser_Favorites 收藏夹
Browser_Home 主页
Volume_Mute 静音
Volume_Down 调低音量
Volume_Up 增加音量
Media_Next 下一首
Media_Prev 上一首
Media_Stop 停止
Media_Play_Pause Play/Pause
Launch_Mail 打开默认的电子邮件程序
Launch_Media 打开默认的媒体播放器
Launch_App1 打开我的电脑
Launch_App2 打开计算器
注:上面列出的每个按键的功能可以通过修改 Windows 注册表进行替换 这个表格中显示的是在 Windows 系统的大多数版本中每个按键的默认功能
特别
AppsKey 菜单键 这是调用右键上下文菜单的按键
PrintScreen 捕获屏幕
CtrlBreak
暂停 暂停键
中断 中断键 由于此键和 Pause 含义相同,所以在热键中请使用 ^CtrlBreak 代替 ^Pause 或^Break
帮助 帮助键 此键可能在大多数键盘上不存在 它通常和 F1 不同.
Sleep 休眠键 注意在一些键盘上的 sleep 键可能不是休眠功能
SCnnn 请在 nnn 中指定按键的扫描码 识别上面没有提到的罕见的按键 请参阅特殊按键了解详情
VKnn 请在 nn 中指定十六进制的虚拟按键码 这种极少用的方法还可以避免某些类型的热键需要安装键盘钩子 例如,后面的热键不使用键盘钩子,但副作用是它会在按下 Home 或 NumpadHome 的其中一个时触发:^VK24::MsgBox You pressed Home or NumpadHome while holding down Control.
已知限制:强制使用键盘钩子的 VK 热键,例如 *VK24 或 ~VK24,只会触发其中一个热键,而不会触发两者(例如触发 NumpadHome 但不触发 Home) 关于 VKnn 方法的更多细节,请参阅特殊按键
;=====================================================================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 ;|;---------------------------------------------------------------------oSetCapsLockState, AlwaysOff ;|;---------------------------------------------------------------------o
;=====================================================================o; CapsLock Switcher: ;|;---------------------------------o-----------------------------------o; CapsLock + ` | {CapsLock} ;|;---------------------------------o-----------------------------------oCapsLock & `:: ;|GetKeyState, CapsLockState, CapsLock, T ;|if CapsLockState = D ;| SetCapsLockState, AlwaysOff ;|else ;| SetCapsLockState, AlwaysOn ;|KeyWait, `` ;|return ;|;---------------------------------------------------------------------o
;=====================================================================o; CapsLock Escaper: ;|;----------------------------------o----------------------------------o; CapsLock | {ESC} ;|;----------------------------------o----------------------------------oCapsLock::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---------------------------------oCapsLock & 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---------------------------------oCapsLock & 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---------------------------------oCapsLock & 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---------------------------------oCapsLock & 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---------------------------------oCapsLock & ,:: 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---------------------------------oCapsLock & 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---------------------------------oCapsLock & 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---------------------------------oCapsLock & 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---------------------------------oCapsLock & d:: Send, !d ;|CapsLock & f:: Send, !f ;|CapsLock & e:: Run http://cn.bing.com/ ;|CapsLock & r:: Run Powershell ;|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---------------------------------oCapsLock & `;:: 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
^RButton:: Run D:\Windows\Snipaste-2.5.1-Beta-x64\Snipaste.exe snip#WheelDown:: Send, {Volume_Down}#WheelUp:: Send, {Volume_Up};~LControl::;if ( A_PriorHotkey=A_ThisHotkey && A_TimeSincePriorHotkey < 400 && A_TimeSincePriorHotkey > 100)
;If WinExist("搜索");WinHide ; 使用前面找到的窗口
;If !WinExist("搜索");else; send +!F; return
CapsLock & space:: Send, {Enter}CapsLock & 1:: Send,{Enter}CapsLock & v::Send, ^!{u}Sleep,2000Send, {right}ReturnPgUp:: Send, ^{c}
Send, {TAB}Send, ^{v}
Send, {ENTER}Return
CapsLock & a:: Send, {Left}
CapsLock & s:: Send, {Down}CapsLock & d:: Send, {Right}CapsLock & w:: Send, {Up}CapsLock & r:: Send, {F5}
CapsLock & Up:: MouseMove, 0, -10, 0, RCapsLock & Down:: MouseMove, 0, 10, 0, RCapsLock & Left:: MouseMove, -10, 0, 0, RCapsLock & Right:: MouseMove, 10, 0, 0, R
CapsLock & RShift:: Send, /
CapsLock & x:: Send, {Del}
CapsLock & z:: Send, {BS}
CapsLock & q:: Send, {PrintScreen}
;CapsLock & 3::
CapsLock & F:: Send, +{;}
CapsLock & 4:: Send,{F11}CapsLock & 5:: Run https://www.52pojie.cn/CapsLock & 6:: Send,+6CapsLock & 7:: Send,+7 ^&&CapsLock & 8:: Send,+8
CapsLock & 9::Run D:\onedrive\XXQG\123.ahkSleep, 1500Send, {F3}return
CapsLock & 0::Run D:\onedrive\XXQG\XXQG.ahkSleep, 1500Send, {F2}return;---------------------------------------------------------------------o
CapsLock & c:: Run PowershellCapsLock & t:: Run C:\WINDOWS\system32\notepad.exe
/*;-----------------------------------oCapsLock & /::Send, ^eSend, creturn;-----------------------------------oCapsLock & \::Send, ^eSend, ureturn-----------------------------------o*/
;上下左右 wasd/*CapsLock & a::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;-----------------------------------oCapsLock & s::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;-----------------------------------oCapsLock & w::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;-----------------------------------oCapsLock & d::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
/*CapsLock & 1:: ;|if GetKeyState("alt") = 1 ;|{ ;| Send,`#`# return ;|} ;| ;| Send,`#`# return ;| ;|return*/
SetCapsLockState, AlwaysOff ;|;---------------------------------------------------------------------o
;=====================================================================o; CapsLock Switcher: ;|;---------------------------------o-----------------------------------o; CapsLock + ` | {CapsLock} ;|;---------------------------------o-----------------------------------oCapsLock & `:: ;|GetKeyState, CapsLockState, CapsLock, T ;|if CapsLockState = D ;| SetCapsLockState, AlwaysOff ;|else ;| SetCapsLockState, AlwaysOn ;|KeyWait, `` ;|return
*/