Skip to content

Instantly share code, notes, and snippets.

@nothings
Created April 18, 2018 08:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nothings/bbb8c7ab3c81cb0c7995ee12062a6627 to your computer and use it in GitHub Desktop.
Save nothings/bbb8c7ab3c81cb0c7995ee12062a6627 to your computer and use it in GitHub Desktop.
// "Virtual" key codes... these are not the same as windows; as many as possible are
// mapped to the ASCII codes so you can ASCII index them, and they're repacked to
// fit from 0..127. There are no keycodes for mouse buttons or IME events.
enum
{
// no mouse button aliases yet (ever?)
STBVK_PAUSE = 0x07, // new?
STBVK_BACK = 0x08,
STBVK_TAB = 0x09, // "\t"
STBVK_LWIN = 0x0a,
STBVK_RWIN = 0x0b,
STBVK_NUMLOCK = 0x0c,
STBVK_ENTER = 0x0d, // "\r"
STBVK_SCROLL = 0x0e,
STBVK_SHIFT = 0x10,
STBVK_CONTROL = 0x11,
STBVK_ALT = 0x12,
STBVK_APPS = 0x13,
STBVK_CAPSLOCK = 0x14, // VK_CAPITAL
STBVK_LSHIFT = 0x15,
STBVK_RSHIFT = 0x16,
STBVK_LCONTROL = 0x17,
STBVK_RCONTROL = 0x18,
STBVK_LALT = 0x19,
STBVK_RALT = 0x1a,
STBVK_ESC = 0x1b, // 27
STBVK_PRTSCR = 0x1c,
STBVK_OEM_8 = 0x1d,
STBVK_NUM_ENTER = 0x1e, // new
STBVK_NUM_DIVIDE= 0x1f,
STBVK_SPACE = 0x20, // " "
STBVK_PAGEUP = 0x21, // VK_PREV
STBVK_PAGEDOWN = 0x22, // VK_NEXT
STBVK_END = 0x23,
STBVK_HOME = 0x24,
STBVK_INSERT = 0x25,
STBVK_DELETE = 0x26,
STBVK_QUOTE = 0x27, // "'"
STBVK_LEFT = 0x28,
STBVK_RIGHT = 0x29,
STBVK_UP = 0x2a,
STBVK_DOWN = 0x2b,
STBVK_COMMA = 0x2c, // ","
STBVK_MINUS = 0x2d, // "-"
STBVK_PERIOD = 0x2e, // "."
STBVK_SLASH = 0x2f, // "/"
// '0'..'9' => 30..39
STBVK_SEMICOLON = 0x3b, // ";"
STBVK_EQUALS = 0x3d, // "="
// 'A'..'Z' => 41..5a
STBVK_OPENBRACE = 0x5b, // "["
STBVK_BACKSLASH = 0x5c, // "\\"
STBVK_CLOSEBRACE= 0x5d, // "]"
STBVK_BACKQUOTE = 0x60, // "`"
STBVK_NUM_0 = 0x61,
STBVK_NUM_1 = 0x62,
STBVK_NUM_2 = 0x63,
STBVK_NUM_3 = 0x64,
STBVK_NUM_4 = 0x65,
STBVK_NUM_5 = 0x66,
STBVK_NUM_6 = 0x67,
STBVK_NUM_7 = 0x68,
STBVK_NUM_8 = 0x69,
STBVK_NUM_9 = 0x6a,
STBVK_NUM_MULITPLY = 0x6b,
STBVK_NUM_ADD = 0x6c,
STBVK_NUM_SEPARATOR = 0x6d,
STBVK_NUM_SUBTRACT = 0x6e,
STBVK_NUM_DECIMAL = 0x6f,
STBVK_F1 = 0x70,
STBVK_F2 = 0x71,
STBVK_F3 = 0x72,
STBVK_F4 = 0x73,
STBVK_F5 = 0x74,
STBVK_F6 = 0x75,
STBVK_F7 = 0x76,
STBVK_F8 = 0x77,
STBVK_F9 = 0x78,
STBVK_F10 = 0x79,
STBVK_F11 = 0x7a,
STBVK_F12 = 0x7b,
STBVK_F13 = 0x7c,
STBVK_F14 = 0x7d,
STBVK_F15 = 0x7e,
STBVK_F16 = 0x7f,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment