This page is a complete list of key notations for AutoHotkey. See also: AutoHotkey Basics ◇ AutoHotkey Example Scripts.
Here's the basic syntax for modifier keys when used together with another key.
| Key | Syntax |
|---|---|
| Alt | ! |
| Ctrl | ^ |
| Shift | + |
| Win Logo | # |
Examples:
!n::Run Notepad ; this means Alt+n ^n::Run Notepad ; this means Ctrl+n +n::Run Notepad ; this means Shift+n #n::Run Notepad ; this means the Win+n
To have a combination of modifier keys, just combine them together, like this:
F6::Run Notepad ; F6 ^F6::Run Notepad ; Ctrl+F6 ^!n::Run Notepad ; Ctrl+Alt+n
Here's fully speltout variant syntax of the modifer keys. They are especially useful when you want to define a modifier key by itself, without combining other keys.
| Key | Syntax |
|---|---|
| left Windows logo | LWin |
| right Windows logo | RWin |
| Control | Control |
| left Control | LControl |
| right Control | RControl |
| Shift | Shift |
| left Shift | LShift |
| right Shift | RShift |
| Alt | Alt |
| left Alt | LAlt |
| right Alt | RAlt |
| Menu Key | AppsKey |
Notes:
~Alt. By contrast, a specific left or right hotkey such as LAlt:: fires when it is pressed down.For simple modifier keys such as {Alt, Ctrl, ⇧ Shift, Win Logo}, the syntax for pressing them together is just combining the notation. Example:
F6::Run Notepad ; F6 ^F6::Run Notepad ; Ctrl+F6 ^!n::Run Notepad ; Ctrl+Alt+n
Example of key combination on the right side:
RControl::Send ^!+9 ; set right Ctrl to Ctrl+Alt+Shift+9
Other modifier keys combination on the left side needs to use &. Example:
AppsKey & n::Run Notepad ; MenuKey+n
Example of key combination/sequence on the left and/or right side:
Control & F11::Send ^t ; set Ctrl+F11 to Ctrl+t AppsKey & e::Send (){Left} ; insert paren, move cursor in between AppsKey & u::Send {{}{}}{Left} ; insert braces AppsKey & o::Send []{Left} ; insert square brackets LWin & NumpadMult::Send !{Esc} ; switch to next window and hide current. Alt+Esc LWin & NumpadDiv::Send !+{Esc} ; switch to previous window. Alt+Shift+Esc #NumpadAdd::Send {Volume_Up 5} ; increase sound level. Win+NumpadAdd #NumpadSub::Send {Volume_Down 5} ; decrease sound level. Win+NumpadSub #NumpadEnter::Run "C:\Windows\System32\SndVol.exe" ; NumpadEnter key ~LWin Up::Return ; disable Win key behavior of popping up the Start Menu, but still allow Win+‹key› combination.
Here's a complete list of other key's syntax.
The syntax is F1, F2, F3… etc. Example:
F1::Run Notepad ; F1 key ^F1::Run Notepad ; Ctrl+F1
| Key | Syntax |
|---|---|
| Space | Space |
| Tab | Tab |
| Enter | Enter |
| Esc | Esc |
| Backspace | Backspace |
Example:
Space::Run Notepad ; Space key ^Space::Run Notepad ; Ctrl+Space
| Key | Syntax |
|---|---|
| Delete | Del |
| Insert | Ins |
| Home | Home |
| End | End |
| Page Up | PgUp |
| Page Down | PgDn |
| Key | Syntax |
|---|---|
| ↑ | Up |
| ↓ | Down |
| ← | Left |
| → | Right |
| Key | Syntax |
|---|---|
| ScrLk | ScrollLock |
| Caps Lock | CapsLock |
| PrtScn/SysRq | PrintScreen |
| Pause/Break | Pause |
If you want 【Ctrl+Pause】, use the syntax ^CtrlBreak.
| Key | Syntax |
|---|---|
| Num Lock | NumLock |
| Key | Syntax |
|---|---|
| 0 | Numpad0 |
| 1 | Numpad1 |
| 2 | Numpad2 |
| 3 | Numpad3 |
| 4 | Numpad4 |
| 5 | Numpad5 |
| 6 | Numpad6 |
| 7 | Numpad7 |
| 8 | Numpad8 |
| 9 | Numpad9 |
| + | NumpadAdd |
| / | NumpadDiv |
| . | NumpadDot |
| * | NumpadMult |
| - | NumpadSub |
| Enter | NumpadEnter |
| Key | Syntax |
|---|---|
| End | NumpadEnd |
| Home | NumpadHome |
| PgDn | NumpadPgDn |
| PgUp | NumpadPgUp |
| Del | NumpadDel |
| Ins | NumpadIns |
| ← | NumpadLeft |
| → | NumpadRight |
| ↑ | NumpadUp |
| ↓ | NumpadDown |
The following are syntax for special buttons on many of today's keyboards.
| Button | Syntax |
|---|---|
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 | |
Launch_Mail | |
Launch_Media | |
Launch_App1 | |
Launch_App2 | |
Sleep |
| Button | Syntax |
|---|---|
| left | LButton |
| right | RButton |
| scroll wheel | MButton |
| Forward (4th button) | XButton1 |
| Backward (5th button) | XButton2 |
| Button | Syntax |
|---|---|
| scroll wheel up | WheelUp |
| scroll wheel down | WheelDown |
| mouse wheel left push | WheelLeft |
| mouse wheel right push | WheelRight |