List of keycode constants

From Spheriki

Jump to: navigation, search

This is a list of keycodes you can use in your scripts. Please note that for backwards compatibility reasons Sphere does not support extra keys such as those found on a multimedia keyboard, nor does it support the "Meta" key (the "Windows" key on PC, the "Apple" key on Mac).

Contents

Alphanumeric section

Function keys

The following constants represent the keys on the function key row (F-something).

KEY_ESCAPE
KEY_F1
KEY_F2
KEY_F3
KEY_F4
KEY_F5
KEY_F6
KEY_F7
KEY_F8
KEY_F9
KEY_F10
KEY_F11
KEY_F12

Number row

The following constants represent keys in the number row.

KEY_TILDE
KEY_0
KEY_1
KEY_2
KEY_3
KEY_4
KEY_5
KEY_6
KEY_7
KEY_8
KEY_9
KEY_MINUS
KEY_EQUALS
KEY_BACKSPACE

Alphabet

The following constants represent the keys of the standard 26-letter English alphabet and tab.

KEY_TAB
KEY_A
KEY_B
KEY_C
KEY_D
KEY_E
KEY_F
KEY_G
KEY_H
KEY_I
KEY_J
KEY_K
KEY_L
KEY_M
KEY_N
KEY_O
KEY_P
KEY_Q
KEY_R
KEY_S
KEY_T
KEY_U
KEY_V
KEY_W
KEY_X
KEY_Y
KEY_Z

Symbols and modifiers

The following constants represent the remaining keys in the alphanumeric section of the keyboard. There is no distinction between left and right shift, left and right control, or left and right alt.

KEY_SHIFT
KEY_CAPSLOCK
KEY_NUMLOCK
KEY_SCROLLOCK
KEY_CTRL
KEY_ALT
KEY_SPACE
KEY_OPENBRACE
KEY_CLOSEBRACE
KEY_SEMICOLON
KEY_APOSTROPHE
KEY_COMMA
KEY_PERIOD
KEY_SLASH
KEY_BACKSLASH
KEY_ENTER

Directional control

The following constants represent the directional control keys (usually situated between the main alphanumeric section and the number pad). Please note, on a Mac certain keys might be replaced with something else.

KEY_INSERT
KEY_DELETE
KEY_HOME
KEY_END
KEY_PAGEUP
KEY_PAGEDOWN
KEY_UP
KEY_RIGHT
KEY_DOWN
KEY_LEFT

Number pad

The following constants represent keys of the number pad (assuming your keyboard has one).

KEY_NUM_0
KEY_NUM_1
KEY_NUM_2
KEY_NUM_3
KEY_NUM_4
KEY_NUM_5
KEY_NUM_6
KEY_NUM_7
KEY_NUM_8
KEY_NUM_9
Personal tools