Key Codes (for Use with Words WatchHotKey: and SEND-KEYS:)

This section explains how to use various key codes with words WatchHotKey:, SEND-KEYS: and WIN-SEND-KEYS:.

In order to use any alphanumeric key as an argument for these words, you can just use the corresponding character in quotation marks (case-sensitive). For example, letters A, b and f all correspond to their respective keys. You can use several letters together: e.g. string AbC corresponds to pressing A, b and C.

The plus sign (+), caret (^), at sign (@), dollar sign ($) have special meanings. Normally, they are used to represent functional keys SHIFT, CTRL, ALT and WIN, respectively. To use these characters in an argument as characters and not as symbols for functional keys, you have to place them inside of curly braces ({+}, {^}, {@}, {$}). If you have to use braces in a parameter of one of the above words, use double braces ( {{ and }} ), and use {QUOTE} for a quotation mark.

Examples:

SEND-KEYS: "A"
SEND-KEYS: "qwe" 
SEND-KEYS: "Valery Kondakoff"
SEND-KEYS: "support{@}nncron.ru" \ support@nncron.ru
SEND-KEYS: "2 {+} 2"          \ 2 + 2
SEND-KEYS: "{QUOTE}Micro{$}oft{QUOTE} Company" \ "Micro$oft" Company

As mentioned above, keys SHIFT, CTRL and ALT are represented by special characters:

Key Code
ALT @
CTRL ^
SHIFT +

Microsoft Natural Keyboard or any other compatible keyboard includes two additional keys: the Windows logo key (WIN) and the Application key (APP):

Key Code
APP {APP}
WIN $

To specify characters that aren't displayed when you press a key, such as ENTER or TAB, and keys that represent actions rather than characters, use the codes shown below:

Key Code
BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER {ENTER}
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT}
LEFT ARROW {LEFT}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}

You can also use the numpad keys, wich are located in the right side of your keyboard (so called grey keys):

Key Code
+
{ADD}
. {DECIMAL}
/ {DIVIDE}
* {MULTIPLY}
NUM LOCK {NUMLOCK}
- {SUBTRACT}
0 {NUMPAD0}
1 {NUMPAD1}
2 {NUMPAD2}
3 {NUMPAD3}
4 {NUMPAD4}
5 {NUMPAD5}
6 {NUMPAD6}
7 {NUMPAD7}
8 {NUMPAD8}
9 {NUMPAD9}

nnCron can handle multimedia keys, that are available on several extended keyboards. We are expecting these keys to work smoothly with SEND-KEYS:, but currently we have not such a keyboard and we can't test how these keys will work with WatchHotKey:. Anyway, here are the multimedia key codes:

Code Code Code Code
{BROWSER_BACK} {VOLUME_MUTE} {MEDIA_NEXT_TRACK} {LAUNCH_MAIL}
{BROWSER_FORWARD} {VOLUME_DOWN} {MEDIA_PREV_TRACK} {LAUNCH_MEDIA_SELECT}
{BROWSER_REFRESH} {VOLUME_UP} {MEDIA_STOP} {LAUNCH_APP1}
{BROWSER_STOP}   {MEDIA_PLAY_PAUSE} {LAUNCH_APP2}
{BROWSER_SEARCH}      
{BROWSER_FAVORITES}      

{BROWSER_HOME}

     

Examples:

SEND-KEYS: "First line.{ENTER}Second line."\ two  lines
SEND-KEYS: "Temp{BS}{BS}st" \ Test
WatchHotKey: "^@s"          \ CTRL + ALT + s
WatchHotKey: "$5"           \ WIN + 5