Примечание: для повышения читабельности необходимо писать в нижнем регистре
keymap["KEY_ESCAPE"] = 0x01;
keymap["KEY_1"] = 0x02;
keymap["KEY_2"] = 0x03;
keymap["KEY_3"] = 0x04;
keymap["KEY_4"] = 0x05;
keymap["KEY_5"] = 0x06;
keymap["KEY_6"] = 0x07;
keymap["KEY_7"] = 0x08;
keymap["KEY_8"] = 0x09;
keymap["KEY_9"] = 0x0A;
keymap["KEY_0"] = 0x0B;
keymap["KEY_MINUS"] = 0x0C;
keymap["KEY_EQUALS"] = 0x0D;
keymap["KEY_BACK"] = 0x0E;
keymap["KEY_TAB"] = 0x0F;
keymap["KEY_Q"] = 0x10;
keymap["KEY_W"] = 0x11;
keymap["KEY_E"] = 0x12;
keymap["KEY_R"] = 0x13;
keymap["KEY_T"] = 0x14;
keymap["KEY_Y"] = 0x15;
keymap["KEY_U"] = 0x16;
keymap["KEY_I"] = 0x17;
keymap["KEY_O"] = 0x18;
keymap["KEY_P"] = 0x19;
keymap["KEY_LBRACKET"] = 0x1A;
keymap["KEY_RBRACKET"] = 0x1B;
keymap["KEY_RETURN"] = 0x1C;
keymap["KEY_LCONTROL"] = 0x1D;
keymap["KEY_A"] = 0x1E;
keymap["KEY_S"] = 0x1F;
keymap["KEY_D"] = 0x20;
keymap["KEY_F"] = 0x21;
keymap["KEY_G"] = 0x22;
keymap["KEY_H"] = 0x23;
keymap["KEY_J"] = 0x24;
keymap["KEY_K"] = 0x25;
keymap["KEY_L"] = 0x26;
keymap["KEY_SEMICOLON"] = 0x27;
keymap["KEY_APOSTROPHE"] = 0x28;
keymap["KEY_GRAVE"] = 0x29;
keymap["KEY_LSHIFT"] = 0x2A;
keymap["KEY_BACKSLASH"] = 0x2B;
keymap["KEY_Z"] = 0x2C;
keymap["KEY_X"] = 0x2D;
keymap["KEY_C"] = 0x2E;
keymap["KEY_V"] = 0x2F;
keymap["KEY_B"] = 0x30;
keymap["KEY_N"] = 0x31;
keymap["KEY_M"] = 0x32;
keymap["KEY_COMMA"] = 0x33;
keymap["KEY_PERIOD"] = 0x34;
keymap["KEY_SLASH"] = 0x35;
keymap["KEY_RSHIFT"] = 0x36;
keymap["KEY_MULTIPLY"] = 0x37;
keymap["KEY_LALT"] = 0x38;
keymap["KEY_SPACE"] = 0x39;
keymap["KEY_CAPSLOCK"] = 0x3A;
keymap["KEY_F1"] = 0x3B;
keymap["KEY_F2"] = 0x3C;
keymap["KEY_F3"] = 0x3D;
keymap["KEY_F4"] = 0x3E;
keymap["KEY_F5"] = 0x3F;
keymap["KEY_F6"] = 0x40;
keymap["KEY_F7"] = 0x41;
keymap["KEY_F8"] = 0x42;
keymap["KEY_F9"] = 0x43;
keymap["KEY_F10"] = 0x44;
keymap["KEY_NUMLOCK"] = 0x45;
keymap["KEY_SCROLL"] = 0x46;
keymap["KEY_NUMPAD7"] = 0x47;
keymap["KEY_NUMPAD8"] = 0x48;
keymap["KEY_NUMPAD9"] = 0x49;
keymap["KEY_SUBTRACT"] = 0x4A;
keymap["KEY_NUMPAD4"] = 0x4B;
keymap["KEY_NUMPAD5"] = 0x4C;
keymap["KEY_NUMPAD6"] = 0x4D;
keymap["KEY_ADD"] = 0x4E;
keymap["KEY_NUMPAD1"] = 0x4F;
keymap["KEY_NUMPAD2"] = 0x50;
keymap["KEY_NUMPAD3"] = 0x51;
keymap["KEY_NUMPAD0"] = 0x52;
keymap["KEY_DECIMAL"] = 0x53;
keymap["KEY_F11"] = 0x57;
keymap["KEY_F12"] = 0x58;
keymap["KEY_F13"] = 0x64;
keymap["KEY_F14"] = 0x65;
keymap["KEY_F15"] = 0x66;
keymap["KEY_KANA"] = 0x70;
keymap["KEY_CONVERT"] = 0x79;
keymap["KEY_NOCONVERT"] = 0x7B;
keymap["KEY_YEN"] = 0x7D;
keymap["KEY_NUMPADEQUALS"] = 0x8D;
keymap["KEY_CIRCUMFLEX"] = 0x90;
keymap["KEY_AT"] = 0x91;
keymap["KEY_COLON"] = 0x92;
keymap["KEY_UNDERLINE"] = 0x93;
keymap["KEY_KANJI"] = 0x94;
keymap["KEY_STOP"] = 0x95;
keymap["KEY_AX"] = 0x96;
keymap["KEY_UNLABELED"] = 0x97;
keymap["KEY_NUMPADENTER"] = 0x9C;
keymap["KEY_RCONTROL"] = 0x9D;
keymap["KEY_NUMPADCOMMA"] = 0xB3;
keymap["KEY_DIVIDE"] = 0xB5;
keymap["KEY_SYSRQ"] = 0xB7;
keymap["KEY_RALT"] = 0xB8;
keymap["KEY_PAUSE"] = 0xC5;
keymap["KEY_HOME"] = 0xC7;
keymap["KEY_UP"] = 0xC8;
keymap["KEY_PRIOR"] = 0xC9;
keymap["KEY_LEFT"] = 0xCB;
keymap["KEY_RIGHT"] = 0xCD;
keymap["KEY_END"] = 0xCF;
keymap["KEY_DOWN"] = 0xD0;
keymap["KEY_NEXT"] = 0xD1;
keymap["KEY_INSERT"] = 0xD2;
keymap["KEY_DELETE"] = 0xD3;
keymap["KEY_LWIN"] = 0xDB;
keymap["KEY_RWIN"] = 0xDC;
keymap["KEY_APPS"] = 0xDD;
keymap["KEY_ESC"] = KEY_ESCAPE;
keymap["KEY_ENTER"] = KEY_ENTER;
keymap["KEY_BACKSPACE"] = KEY_BACK;
keymap["KEY_NUMPADSTAR"] = KEY_MULTIPLY;
keymap["KEY_NUMPADMINUS"] = KEY_SUBTRACT;
keymap["KEY_NUMPADPLUS"] = KEY_ADD;
keymap["KEY_NUMPADPERIOD"] = KEY_DECIMAL;
keymap["KEY_NUMPADSLASH"] = KEY_DIVIDE;
keymap["KEY_UPARROW"] = KEY_UP;
keymap["KEY_PGUP"] = KEY_PRIOR;
keymap["KEY_LEFTARROW"] = KEY_LEFT;
keymap["KEY_RIGHTARROW"] = KEY_RIGHT;
keymap["KEY_DOWNARROW"] = KEY_DOWN;
keymap["KEY_PGDN"] = KEY_NEXT;
keymap["MOUSE0"] = MOUSE0;
keymap["MOUSE1"] = MOUSE1;
keymap["MOUSE2"] = MOUSE2;
keymap["MOUSE3"] = MOUSE3;
keymap["MOUSE4"] = MOUSE4;
keymap["MOUSE5"] = MOUSE5;
keymap["MOUSE6"] = MOUSE6;
keymap["MOUSE7"] = MOUSE7;
keymap["MOUSE_LEFT"] = MOUSE_LEFT;
keymap["MOUSE_RIGHT"] = MOUSE_RIGHT;
keymap["MOUSE_MIDLE"] = MOUSE_MIDLE;
keymap["KEY_CONTROL"] = KEY_CONTROL;
keymap["KEY_ALT"] = KEY_ALT;
keymap["KEY_SHIFT"] = KEY_SHIFT;
keymap["ALT"] = KF_ALT;
keymap["CTRL"] = KF_CTRL;
keymap["SHIFT"] = KF_SHIFT;
keymap["DOUBLE"] = KF_DOUBLE;
keymap["~ALT"] = KF_NOALT;
keymap["~CTRL"] = KF_NOCTRL;
keymap["~SHIFT"] = KF_NOSHIFT;
keymap["~DOUBLE"] = KF_NODOUBLE.