"""
from dinput.h
"""

dinput_key_codes = {
    "BACKSPACE": 0x0E,
    "TAB": 0x0F,
    "CLEAR": 0,  # FIXME
    "RETURN": 0x1C,
    "PAUSE": 0,  # FIXME
    "ESCAPE": 0x01,
    "SPACE": 0x39,
    "EXCLAIM": 0,  # FIXME
    "QUOTEDBL": 0,  # FIXME
    "HASH": 0,  # FIXME
    "DOLLAR": 0,  # FIXME
    "AMPERSAND": 0,  # FIXME
    "QUOTE": 0x28,
    "LEFTPAREN": 0,  # FIXME
    "RIGHTPAREN": 0,  # FIXME
    "ASTERISK": 0,  # FIXME
    "PLUS": 0,  # FIXME
    "COMMA": 0x33,
    "MINUS": 0x0C,
    "PERIOD": 0x34,
    "SLASH": 0x35,
    "0": 0x0B,
    "1": 0x02,
    "2": 0x03,
    "3": 0x04,
    "4": 0x05,
    "5": 0x06,
    "6": 0x07,
    "7": 0x08,
    "8": 0x09,
    "9": 0x0A,
    "COLON": 0x92,
    "SEMICOLON": 0x27,
    "LESS": 0,  # FIXME
    "EQUALS": 0x0D,
    "GREATER": 0,  # FIXME
    "QUESTION": 0,  # FIXME
    "AT": 0x91,
    "LEFTBRACKET": 0x1A,
    "BACKSLASH": 0x2B,
    "RIGHTBRACKET": 0x1B,
    "CARET": 0,  # FIXME
    "UNDERSCORE": 0x93,
    "BACKQUOTE": 0,  # FIXME
    "A": 0x1E,
    "B": 0x30,
    "C": 0x2E,
    "D": 0x20,
    "E": 0x12,
    "F": 0x21,
    "G": 0x22,
    "H": 0x23,
    "I": 0x17,
    "J": 0x24,
    "K": 0x25,
    "L": 0x26,
    "M": 0x32,
    "N": 0x31,
    "O": 0x18,
    "P": 0x19,
    "Q": 0x10,
    "R": 0x13,
    "S": 0x1F,
    "T": 0x14,
    "U": 0x16,
    "V": 0x2F,
    "W": 0x11,
    "X": 0x2D,
    "Y": 0x15,
    "Z": 0x2C,
    "DELETE": 0xD3,
    "KP0": 0x52,
    "KP1": 0x4F,
    "KP2": 0x50,
    "KP3": 0x51,
    "KP4": 0x4B,
    "KP5": 0x4C,
    "KP6": 0x4D,
    "KP7": 0x47,
    "KP8": 0x48,
    "KP9": 0x49,
    "KP_PERIOD": 0x53,
    "KP_DIVIDE": 0xB5,
    "KP_MULTIPLY": 0x37,
    "KP_MINUS": 0x4A,
    "KP_PLUS": 0x4E,
    "KP_ENTER": 0x9C,
    "KP_EQUALS": 0x8D,
    "UP": 0xC8,
    "DOWN": 0xD0,
    "RIGHT": 0xCD,
    "LEFT": 0xCB,
    "INSERT": 0xD2,
    "HOME": 0xC7,
    "END": 0xCF,
    "PAGEUP": 0xC9,
    "PAGEDOWN": 0xD1,
    "F1": 0x3B,
    "F2": 0x3C,
    "F3": 0x3D,
    "F4": 0x3E,
    "F5": 0x3F,
    "F6": 0x40,
    "F7": 0x41,
    "F8": 0x42,
    "F9": 0x43,
    "F10": 0x44,
    "F11": 0x57,
    "F12": 0x58,
    "F13": 0x64,
    "F14": 0x65,
    "F15": 0x66,
    "NUMLOCK": 0x45,
    "CAPSLOCK": 0x3A,
    "SCROLLOCK": 0x46,
    "RSHIFT": 0x36,
    "LSHIFT": 0x2A,
    "RCTRL": 0x9D,
    "LCTRL": 0x1D,
    "RALT": 0xB8,
    "LALT": 0x38,
    "RMETA": 0,  # FIXME
    "LMETA": 0,  # FIXME
    "LSUPER": 0xDB,
    "RSUPER": 0xDC,
    "MODE": 0,  # FIXME
    "COMPOSE": 0,  # FIXME
    "HELP": 0,  # FIXME
    "PRINT": 0,  # FIXME
    "SYSREQ": 0xB7,
    "BREAK": 0,  # FIXME
    "MENU": 0,  # FIXME
    "POWER": 0,  # FIXME
    "EURO": 0,  # FIXME
    "UNDO": 0,  # FIXME
}


sdlk_to_dik = {
    "ESCAPE": "ESCAPE",
    "1": "1",
    "2": "2",
    "3": "3",
    "4": "4",
    "5": "5",
    "6": "6",
    "7": "7",
    "8": "8",
    "9": "9",
    "0": "0",
    "MINUS": "MINUS",
    "EQUALS": "EQUALS",
    "BACKSPACE": "BACK",
    "TAB": "TAB",
    "Q": "Q",
    "W": "W",
    "E": "E",
    "R": "R",
    "T": "T",
    "Y": "Y",
    "U": "U",
    "I": "I",
    "O": "O",
    "P": "P",
    "LEFTBRACKET": "LBRACKET",
    "RIGHTBRACKET": "RBRACKET",
    "RETURN": "RETURN",
    "LCTRL": "LCONTROL",
    "A": "A",
    "S": "S",
    "D": "D",
    "F": "F",
    "G": "G",
    "H": "H",
    "J": "J",
    "K": "K",
    "L": "L",
    "SEMICOLON": "SEMICOLON",
    "QUOTE": "APOSTROPHE",
    "BACKQUOTE": "GRAVE",
    "LSHIFT": "LSHIFT",
    "BACKSLASH": "BACKSLASH",
    "Z": "Z",
    "X": "X",
    "C": "C",
    "V": "V",
    "B": "B",
    "N": "N",
    "M": "M",
    "COMMA": "COMMA",
    "PERIOD": "PERIOD",
    "SLASH": "SLASH",
    "RSHIFT": "RSHIFT",
    "KP_MULTIPLY": "MULTIPLY",
    "LALT": "LMENU",
    "SPACE": "SPACE",
    "CAPSLOCK": "CAPITAL",
    "F1": "F1",
    "F2": "F2",
    "F3": "F3",
    "F4": "F4",
    "F5": "F5",
    "F6": "F6",
    "F7": "F7",
    "F8": "F8",
    "F9": "F9",
    "F10": "F10",
    "NUMLOCK": "NUMLOCK",
    "SCROLLOCK": "SCROLL",
    "KP7": "NUMPAD7",
    "KP8": "NUMPAD8",
    "KP9": "NUMPAD9",
    "KP_MINUS": "SUBTRACT",
    "KP4": "NUMPAD4",
    "KP5": "NUMPAD5",
    "KP6": "NUMPAD6",
    "KP_PLUS": "ADD",
    "KP1": "NUMPAD1",
    "KP2": "NUMPAD2",
    "KP3": "NUMPAD3",
    "KP0": "NUMPAD0",
    "KP_PERIOD": "DECIMAL",
    "F11": "F11",
    "F12": "F12",
    "F13": "F13",
    "F14": "F14",
    "F15": "F15",
    # "": "KANA",
    # "": "CONVERT",
    # "": "NOCONVERT",
    # "": "YEN",
    # "": "NUMPADEQUALS",
    # "": "CIRCUMFLEX",
    "AT": "AT",
    "COLON": "COLON",
    # "": "UNDERLINE",
    # "": "KANJI",
    # "": "STOP",
    # "": "AX",
    # "": "UNLABELED",
    "KP_ENTER": "NUMPADENTER",
    "RCTRL": "RCONTROL",
    # "": "NUMPADCOMMA",
    "KP_DIVIDE": "DIVIDE",
    "SYSREQ": "SYSRQ",
    "RALT": "RMENU",
    "HOME": "HOME",
    "UP": "UP",
    "PAGEUP": "PRIOR",
    "LEFT": "LEFT",
    "RIGHT": "RIGHT",
    "END": "END",
    "DOWN": "DOWN",
    "PAGEDOWN": "NEXT",
    "INSERT": "INSERT",
    "DELETE": "DELETE",
    "LSUPER": "LWIN",
    "RSUPER": "RWIN",
    # "": "APPS",
}

# "BACKSPACE": "BACKSPACE       DIK_BACK            /* backspace */
# "KP_MULTIPLY": "NUMPADSTAR      DIK_MULTIPLY        /* * on numeric keypad */
# "": "LALT            DIK_LMENU           /* left Alt */
# "": "CAPSLOCK        DIK_CAPITAL         /* CapsLock */
# "": "NUMPADMINUS     DIK_SUBTRACT        /* - on numeric keypad */
# "": "NUMPADPLUS      DIK_ADD             /* + on numeric keypad */
# "": "NUMPADPERIOD    DIK_DECIMAL         /* . on numeric keypad */
# "": "NUMPADSLASH     DIK_DIVIDE          /* / on numeric keypad */
# "": "RALT            DIK_RMENU           /* right Alt */
# "": "UPARROW         DIK_UP              /* UpArrow on arrow keypad */
# "": "PGUP            DIK_PRIOR           /* PgUp on arrow keypad */
# "": "LEFTARROW       DIK_LEFT            /* LeftArrow on arrow keypad */
# "": "RIGHTARROW      DIK_RIGHT           /* RightArrow on arrow keypad */
# "": "DOWNARROW       DIK_DOWN            /* DownArrow on arrow keypad */
# "": "PGDN            DIK_NEXT            /* PgDn on arrow keypad */
