If you naming a function (valueMapper), then it is not an anonymous function. You don't need to iterate over the Properties using Object.Keys as you are passing the property value as an argument to your function. However, As a gaurd you can check if the passed in property name matches the existing properties on the object.
xterm, you can redefine any key. Most X servers understandhow to intercept the function, or
F keys. Ifyou want to set an
xterm function key to send a particularstring, add a line using the format below to your
? in the above example with a numberbetween 1 and 10, representing one of the
F10 keys, and replace
whatever with the stringyou want that key to send.
For example, the string which represents the
PF1 key onthe VT100 keyboard is
<ESC>OP ('O' and'P' are uppercase). So, to cause the
F1 key to send a
PF1 character sequence, add this line to your
^[ above represents an
Esccharacter. See your editor's documentation for information on how toinsert this special character.
Similarly, for binding the
F2 key to
F3 key to
PF3, and the
PF4 respectively, you must add the following linesto your
After doing this, in order to let your X server know what the newdefaults are, type:
xrdb is invoked when you start your X server.
At Indiana University, for personal or departmental Linux or Unix systems support, see Get help for Linux or Unix at IU.
|LButton||The left mouse button when used with Send, but the primary mouse button when used with hotkeys. In other words, if the user has swapped the buttons via system settings, |
|RButton||The right mouse button when used with Send, but the secondary mouse button when used with hotkeys. In other words, if the user has swapped the buttons via system settings, |
|MButton||Middle or wheel mouse button|
|XButton1||4th mouse button. Typically performs the same function as Browser_Back.|
|XButton2||5th mouse button. Typically performs the same function as Browser_Forward.|
|WheelDown||Turn the wheel downward (toward you).|
|WheelUp||Turn the wheel upward (away from you).|
[v1.0.48+]: Scroll to the left or right.
Requires Windows Vista or later. These can be used as hotkeys with some (but not all) mice which have a second wheel or support tilting the wheel to either side. In some cases, software bundled with the mouse must instead be used to control this feature. Regardless of the particular mouse, Send and Click can be used to scroll horizontally in programs which support it.
Note: 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.
|CapsLock||CapsLock (caps lock key) |
Note: Windows IME may interfere with the detection and functionality of CapsLock; see CapsLock and IME for details.
|Space||Space (space bar)|
|Tab||Tab (tabulator key)|
|Return||Deprecated: Use the synonym |
|Escape (or Esc)||Esc|
|Backspace (or BS)||Backspace|
|ScrollLock||ScrollLock (scroll lock key). While Ctrl is held down, ScrollLock produces the key code of |
|Delete (or Del)||Del|
|Insert (or Ins)||Ins|
|PgUp||PgUp (page up key)|
|PgDn||PgDn (page down key)|
|Up||↑ (up arrow key)|
|Down||↓ (down arrow key)|
|Left||← (left arrow key)|
|Right||→ (right arrow key)|
Due 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.
|Numpad0 / NumpadIns||0 / Ins|
|Numpad1 / NumpadEnd||1 / End|
|Numpad2 / NumpadDown||2 / ↓|
|Numpad3 / NumpadPgDn||3 / PgDn|
|Numpad4 / NumpadLeft||4 / ←|
|Numpad5 / NumpadClear||5 / typically does nothing|
|Numpad6 / NumpadRight||6 / →|
|Numpad7 / NumpadHome||7 / Home|
|Numpad8 / NumpadUp||8 / ↑|
|Numpad9 / NumpadPgUp||9 / PgUp|
|NumpadDot / NumpadDel||. / Del|
|NumLock||NumLock (number lock key). While Ctrl is held down, NumLock produces the key code of |
|F1 - F24||The 12 or more function keys at the top of most keyboards.|
|LWin||Left Win. Corresponds to the |
Right Win. Corresponds to the
Note: Unlike Ctrl/Alt/Shift, there is no generic/neutral 'Win' key because the OS does not support it. However, hotkeys with the
|Control (or Ctrl)||Ctrl. As a hotkey (|
|Alt||Alt. As a hotkey (|
|Shift||Shift. As a hotkey (|
|LControl (or LCtrl)||Left Ctrl. Corresponds to the |
|RControl (or RCtrl)||Right Ctrl. Corresponds to the |
|LShift||Left Shift. Corresponds to the |
|RShift||Right Shift. Corresponds to the |
|LAlt||Left Alt. Corresponds to the |
Right Alt. Corresponds to the
Note: If your keyboard layout has AltGr instead of RAlt, you can probably use it as a hotkey prefix via
The 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.
|Volume_Mute||Mute the volume|
|Volume_Down||Lower the volume|
|Volume_Up||Increase the volume|
|Launch_Mail||Launch default e-mail program|
|Launch_Media||Launch default media player|
|Launch_App1||Launch My Computer|
|AppsKey||Menu. This is the key that invokes the right-click context menu.|
|PrintScreen||PrtSc (print screen key)|
|CtrlBreak||Ctrl+Pause or Ctrl+ScrollLock|
|Pause||Pause or Ctrl+NumLock. While Ctrl is held down, Pause produces the key code of |
|Break||Deprecated: Use the synonym |
|Help||Help. This probably doesn't exist on most keyboards. It's usually not the same as F1.|
|Sleep||Sleep. Note that the sleep key on some keyboards might not work with this.|
|SCnnn||Specify for nnn the scan code of a key. Recognizes unusual keys not mentioned above. See Special Keys for details.|
Specify for nn the hexadecimal virtual key code of a key. This rarely-used method also prevents certain types of hotkeys from requiring the keyboard hook. For example, the following hotkey does not use the keyboard hook, but as a side-effect it is triggered by pressing eitherHome or NumpadHome:
Known limitation: VK hotkeys that are forced to use the keyboard hook, such as
Warning: Only Send, GetKeyName(), GetKeyVK(), GetKeySC() and #MenuMaskKey support combining VKnn and SCnnn. [v1.1.27+]: The presence of an invalid suffix prevents VKnn from being recognized. For example,
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.
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.
Respond to signals from hand-held remote controls via the WinLIRC client script.
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:
Reverse direction: To remap some other key to become a 'mystery key', follow this example:
Alternate solutions: If your key or mouse button is not detectable by the Key History screen, one of the following might help:
Reconfigure the software that came with your mouse or keyboard (sometimes accessible in the Control Panel or Start Menu) to have the 'mystery key' send some other keystroke. Such a keystroke can then be defined as a hotkey in a script. For example, if you configure a mystery key to send Ctrl+F1, you can then indirectly make that key as a hotkey by using
^F1:: in a script.
Try AHKHID. You can also try searching the forum for a keywords like
USB HID or
The following is a last resort and generally should be attempted only in desperation. This is because the chance of success is low and it may cause unwanted side-effects that are difficult to undo:
Disable or remove any extra software that came with your keyboard or mouse or change its driver to a more standard one such as the one built into the OS. This assumes there is such a driver for your particular keyboard or mouse and that you can live without the features provided by its custom driver and software.
Some 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:
After copying the function into a script or saving it as SendSuppressedKeyUp.ahk in a function library, it can be used as follows: