Table of Contents
MouseGeneral Buttons
Advanced Buttons
Wheel
KeyboardNote: The names of the letter and number keys are the same as that single letter or digit. For example: b is B and 5 is 5. Although any single character can be used as a key name, its meaning (scan code or virtual keycode) depends on the current keyboard layout. Additionally, some special characters may need to be escaped or enclosed in braces, depending on the context. [v1.1.27+]: The letters a-z or A-Z can be used to refer to the corresponding virtual keycodes (usually vk41-vk5A) even if they are not included in the current keyboard layout. General Keys
Cursor Control Keys
Numpad KeysDue to system behavior, the following keys separated by a slash are identified differently depending on whether NumLock is ON or OFF. If NumLock is OFF but Shift is pressed, the system temporarily releases Shift and acts as though NumLock is ON.
Function Keys
Modifier Keys
Multimedia KeysThe function assigned to each of the keys listed below can be overridden by modifying the Windows registry. This table shows the default function of each key on most versions of Windows.
Other Keys
JoystickJoy1 through Joy32: The buttons of the joystick. To help determine the button numbers for your joystick, use this test script. Note that hotkey prefix symbols such as ^ (control) and + (shift) are not supported (though GetKeyState() can be used as a substitute). Also note that the pressing of joystick buttons always "passes through" to the active window if that window is designed to detect the pressing of joystick buttons. Although the following Joystick control names cannot be used as hotkeys, they can be used with GetKeyState():
Multiple Joysticks: If the computer has more than one joystick and you want to use one beyond the first, include the joystick number (max 16) in front of the control name. For example, 2joy1 is the second joystick's first button. Note: If you have trouble getting a script to recognize your joystick, one person reported needing to specify a joystick number other than 1 even though only a single joystick was present. It is unclear how this situation arises or whether it is normal, but experimenting with the joystick number in the joystick test script can help determine if this applies to your system. See Also:
Hand-held Remote ControlsRespond to signals from hand-held remote controls via the WinLIRC client script. Special KeysIf your keyboard or mouse has a key not listed above, you might still be able to make it a hotkey by using the following steps:
Reverse direction: To remap some other key to become a "mystery key", follow this example: ; Replace 159 with the value discovered above. Replace FF (if needed) with the ; key's virtual key, which can be discovered in the first column of the Key History screen. #c::Send {vkFFsc159} ; See Send {vkXXscYYY} for more details. Alternate solutions: If your key or mouse button is not detectable by the Key History screen, one of the following might help:
CapsLock and IMESome configurations of Windows IME (such as Japanese input with English keyboard) use CapsLock to toggle between modes. In such cases, CapsLock is suppressed by the IME and cannot be detected by AutoHotkey. However, the Alt+CapsLock, Ctrl+CapsLock and Shift+CapsLock shortcuts can be disabled with a workaround. Specifically, send a key-up to modify the state of the IME, but prevent any other effects by signalling the keyboard hook to suppress the event. The following function can be used for this purpose: ; Requires AutoHotkey v1.1.26+, and the keyboard hook must be installed. #InstallKeybdHook SendSuppressedKeyUp(key) { DllCall("keybd_event" , "char", GetKeyVK(key) , "char", GetKeySC(key) , "uint", KEYEVENTF_KEYUP := 0x2 , "uptr", KEY_BLOCK_THIS := 0xFFC3D450) } After copying the function into a script or saving it as SendSuppressedKeyUp.ahk in a function library, it can be used as follows: ; Disable Alt+key shortcuts for the IME. ~LAlt::SendSuppressedKeyUp("LAlt") ; Test hotkey: !CapsLock::MsgBox % A_ThisHotkey ; Remap CapsLock to LCtrl in a way compatible with IME. *CapsLock:: Send {Blind}{LCtrl DownR} SendSuppressedKeyUp("LCtrl") return *CapsLock up:: Send {Blind}{LCtrl Up} return |