Advertisement
SMiThaYe

AutoHotkey: List of Keys, Mouse Buttons, and Joystick Contro

Nov 27th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.11 KB | None | 0 0
  1. AutoHotkey: List of Keys, Mouse Buttons, and Joystick Controls
  2. (backup of names for remapping)
  3.  
  4. MOUSE
  5.  
  6. [General]
  7. LButton Left mouse button
  8. RButton Right mouse button
  9. MButton Middle or wheel mouse button
  10.  
  11. [Advanced]
  12. XButton1 4th mouse button. Typically performs the same function as Browser_Back.
  13. XButton2 5th mouse button. Typically performs the same function as Browser_Forward.
  14.  
  15. [Wheel]
  16. WheelDown Turn the wheel downward (toward you).
  17. WheelUp Turn the wheel upward (away from you).
  18.  
  19. WheelLeft Scroll to the left
  20. WheelRight Scroll to the right
  21.  
  22.  
  23. KEYBOARD
  24.  
  25. Note: The names of the letter and number keys are the same as that single letter or digit. For example: b is the "b" key and 5 is the "5" key.
  26.  
  27. [General]
  28. CapsLock Caps lock
  29. Space Space bar
  30. Tab Tab key
  31. Enter (or Return) Enter key
  32. Escape (or Esc) Esc key
  33. Backspace (or BS) Backspace
  34.  
  35. [Cursor Control]
  36. ScrollLock Scroll lock
  37. Delete (or Del) Delete key
  38. Insert (or Ins) Insert key
  39. Home Home key
  40. End End key
  41. PgUp Page Up key
  42. PgDn Page Down key
  43. Up Up arrow key
  44. Down Down arrow key
  45. Left Left arrow key
  46. Right Right arrow key
  47.  
  48. [Numpad]
  49. NumLock ON NumLock OFF
  50. Numpad0 NumpadIns 0 / Insert key
  51. Numpad1 NumpadEnd 1 / End key
  52. Numpad2 NumpadDown 2 / Down arrow key
  53. Numpad3 NumpadPgDn 3 / Page Down key
  54. Numpad4 NumpadLeft 4 / Left arrow key
  55. Numpad5 NumpadClear 5 / typically does nothing
  56. Numpad6 NumpadRight 6 / Right arrow key
  57. Numpad7 NumpadHome 7 / Home key
  58. Numpad8 NumpadUp 8 / Up arrow key
  59. Numpad9 NumpadPgUp 9 / Page Up key
  60. NumpadDot NumpadDel Decimal separation / Delete key
  61. NumpadDiv NumpadDiv Divide
  62. NumpadMult NumpadMult Multiply
  63. NumpadAdd NumpadAdd Add
  64. NumpadSub NumpadSub Subtract
  65. NumpadEnter NumpadEnter Enter key
  66.  
  67. [Function]
  68. F1 - F24 The 12 or more function keys at the top of most keyboards.
  69.  
  70. [Modifier]
  71. LWin Left Windows logo key. Corresponds to the <# hotkey prefix.
  72. RWin Right Windows logo key. Corresponds to the ># hotkey prefix.
  73. Note: Unlike Control/Alt/Shift, there is no generic/neutral "Win" key because the OS does not support it.
  74. However, hotkeys with the # modifier can be triggered by either Win key.
  75. Control (or Ctrl) Control key. As a hotkey (Control::) it fires upon release unless it has the tilde prefix.
  76. Corresponds to the ^ hotkey prefix.
  77. Alt Alt key. As a hotkey (Alt::) it fires upon release unless it has the tilde prefix.
  78. Corresponds to the ! hotkey prefix.
  79. Shift Shift key. As a hotkey (Shift::) it fires upon release unless it has the tilde prefix.
  80. Corresponds to the + hotkey prefix.
  81. LControl (or LCtrl) Left Control key. Corresponds to the <^ hotkey prefix.
  82. RControl (or RCtrl) Right Control key. Corresponds to the >^ hotkey prefix.
  83. LShift Left Shift key. Corresponds to the <+ hotkey prefix.
  84. RShift Right Shift key. Corresponds to the >+ hotkey prefix.
  85. LAlt Left Alt key. Corresponds to the <! hotkey prefix.
  86. RAlt Right Alt key. Corresponds to the >! hotkey prefix.
  87. Note: If your keyboard layout has AltGr instead of RAlt, you can probably use it as a hotkey prefix via
  88. <^>! as described here. In addition, LControl & RAlt:: would make AltGr itself into a hotkey.
  89.  
  90. [Multimedia]
  91. Browser_Back Back
  92. Browser_Forward Forward
  93. Browser_Refresh Refresh
  94. Browser_Stop Stop
  95. Browser_Search Search
  96. Browser_Favorites Favorites
  97. Browser_Home Homepage
  98. Volume_Mute Mute the volume
  99. Volume_Down Lower the volume
  100. Volume_Up Increase the volume
  101. Media_Next Next Track
  102. Media_Prev Previous Track
  103. Media_Stop Stop
  104. Media_Play_Pause Play/Pause
  105. Launch_Mail Launch default e-mail program
  106. Launch_Media Launch default media player
  107. Launch_App1 Launch My Computer
  108. Launch_App2 Launch Calculator
  109.  
  110. Note: The function assigned to each of the keys listed above can be overridden by modifying the Windows registry. This table shows the default function of each key on most versions of Windows.
  111.  
  112. [Special]
  113. AppsKey Menu key. This is the key that invokes the right-click context menu.
  114. PrintScreen Print screen
  115. CtrlBreak
  116. Pause Pause key
  117. Break Break key. Since this is synonymous with Pause, use ^CtrlBreak in hotkeys instead of ^Pause or ^Break.
  118. Help Help key. This probably doesn't exist on most keyboards. It's usually not the same as F1.
  119. Sleep Sleep key. Note that the sleep key on some keyboards might not work with this.
  120. SCnnn Specify for nnn the scan code of a key. Recognizes unusual keys not mentioned above.
  121. See Special Keys for details. https://www.autohotkey.com/docs/KeyList.htm#SpecialKeys
  122. VKnn Specify for nn the hexadecimal virtual key code of a key. This rarely-used method also prevents certain
  123. types of hotkeys from requiring the keyboard hook. For example, the following hotkey does not use the
  124. keyboard hook, but as a side-effect it is triggered by pressing either Home or NumpadHome:
  125. ^VK24::MsgBox You pressed Home or NumpadHome while holding down Control.
  126. Known limitation: VK hotkeys that are forced to use the keyboard hook, such as *VK24 or ~VK24, will fire
  127. for only one of the keys, not both (e.g. NumpadHome but not Home). For more information about the VKnn
  128. method, see Special Keys.
  129.  
  130. JOYSTICK
  131.  
  132. Joy1 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.
  133.  
  134. Although the following Joystick control names cannot be used as hotkeys, they can be used with GetKeyState:
  135. JoyX, JoyY, and JoyZ: The X (horizontal), Y (vertical), and Z (altitude/depth) axes of the joystick.
  136. JoyR: The rudder or 4th axis of the joystick.
  137. JoyU and JoyV: The 5th and 6th axes of the joystick.
  138. JoyPOV: The point-of-view (hat) control.
  139. JoyName: The name of the joystick or its driver.
  140. JoyButtons: The number of buttons supported by the joystick (not always accurate).
  141. JoyAxes: The number of axes supported by the joystick.
  142. JoyInfo: Provides a string consisting of zero or more of the following letters to indicate the joystick's capabilities: Z (has Z axis), R (has R axis), U (has U axis), V (has V axis), P (has POV control), D (the POV control has a limited number of discrete/distinct settings), C (the POV control is continous/fine). Example string: ZRUVPD
  143.  
  144. 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.
  145.  
  146. 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.
  147.  
  148. See Also:
  149. Joystick remapping: methods of sending keystrokes and mouse clicks with a joystick.
  150. https://www.autohotkey.com/docs/misc/RemapJoystick.htm
  151. Joystick-To-Mouse script: using a joystick as a mouse.
  152. https://www.autohotkey.com/docs/scripts/JoystickMouse.htm
  153.  
  154. Hand-held Remote Controls
  155.  
  156. Respond to signals from hand-held remote controls via the WinLIRC client script.
  157.  
  158.  
  159. SPECIAL KEYS
  160.  
  161. If 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:
  162.  
  163. 1. Ensure that at least one script is running that is using the keyboard hook. You can tell if a script has the keyboard
  164. hook by opening its main window and selecting "View->Key history" from the menu bar.
  165. 2. Double-click that script's tray icon to open its main window.
  166. 3. Press one of the "mystery keys" on your keyboard.
  167. 4. Select the menu item "View->Key history"
  168. 5. Scroll down to the bottom of the page. Somewhere near the bottom are the key-down and key-up events for your key. NOTE:
  169. Some keys do not generate events and thus will not be visible here. If this is the case, you cannot directly make that
  170. particular key a hotkey because your keyboard driver or hardware handles it at a level too low for AutoHotkey to access.
  171. For possible solutions, see further below.
  172. 6. If your key is detectible, make a note of the 3-digit hexadecimal value in the second column of the list (e.g. 159).
  173. 7. To define this key as a hotkey, follow this example:
  174. SC159:: ; Replace 159 with your key's value.
  175. MsgBox, %A_ThisHotKey% was pressed.
  176. return
  177.  
  178. Reverse direction: To remap some other key to become a "mystery key", follow this example:
  179.  
  180. ; Replace 159 with the value discovered above. Replace FF (if needed) with the
  181. ; key's virtual key, which can be discovered in the first column of the Key History screen.
  182. #c::Send {vkFFsc159}
  183.  
  184. Alternate solutions: If your key or mouse button is not detectible by the Key History screen, one of the following might help:
  185.  
  186. 1. Reconfigure the software that came with your mouse or keyboard (sometimes accessible in the Control Panel or Start Menu)
  187. to have the "mystery key" send some other keystroke. Such a keystroke can then be defined as a hotkey in a script. For
  188. example, if you configure a mystery key to send Control+F1, you can then indirectly make that key as a hotkey by using
  189. ^F1:: in a script.
  190.  
  191. 2. Try DllCall: Support for Human Interface Devices. You can also try searching the forum for a keyword like RawInput*.
  192. http://www.autohotkey.com/forum/topic6367.html .... http://www.autohotkey.com/forum/
  193.  
  194. 3. The following is a last resort and generally should be attempted only in desperation. This is because the chance of
  195. success is low and it may cause unwanted side-effects that are difficult to undo:
  196. Disable or remove any extra software that came with your keyboard or mouse or change its driver to a more standard one
  197. such as the one built into the OS. This assumes there is such a driver for your particular keyboard or mouse and that you
  198. can live without the features provided by its custom driver and software.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement