#ifndef SDL_SCANCODE_MAP_H
#define SDL_SCANCODE_MAP_H

#include "dethrace_scancodes.h"
#include <SDL.h>

SDL_COMPILE_TIME_ASSERT(sdl2_scancode_map_requires_SDL2, SDL_MAJOR_VERSION == 2);

static int sdl_scancode_map[SDL_NUM_SCANCODES] = {
    [SDL_SCANCODE_ESCAPE] = SCANCODE_ESCAPE,
    [SDL_SCANCODE_1] = SCANCODE_1,
    [SDL_SCANCODE_2] = SCANCODE_2,
    [SDL_SCANCODE_3] = SCANCODE_3,
    [SDL_SCANCODE_4] = SCANCODE_4,
    [SDL_SCANCODE_5] = SCANCODE_5,
    [SDL_SCANCODE_6] = SCANCODE_6,
    [SDL_SCANCODE_7] = SCANCODE_7,
    [SDL_SCANCODE_8] = SCANCODE_8,
    [SDL_SCANCODE_9] = SCANCODE_9,
    [SDL_SCANCODE_0] = SCANCODE_0,
    [SDL_SCANCODE_MINUS] = SCANCODE_MINUS,
    [SDL_SCANCODE_EQUALS] = SCANCODE_EQUALS,
    [SDL_SCANCODE_BACKSPACE] = SCANCODE_BACK,
    [SDL_SCANCODE_TAB] = SCANCODE_TAB,
    [SDL_SCANCODE_Q] = SCANCODE_Q,
    [SDL_SCANCODE_W] = SCANCODE_W,
    [SDL_SCANCODE_E] = SCANCODE_E,
    [SDL_SCANCODE_R] = SCANCODE_R,
    [SDL_SCANCODE_T] = SCANCODE_T,
    [SDL_SCANCODE_Y] = SCANCODE_Y,
    [SDL_SCANCODE_U] = SCANCODE_U,
    [SDL_SCANCODE_I] = SCANCODE_I,
    [SDL_SCANCODE_O] = SCANCODE_O,
    [SDL_SCANCODE_P] = SCANCODE_P,
    [SDL_SCANCODE_LEFTBRACKET] = SCANCODE_LBRACKET,
    [SDL_SCANCODE_RIGHTBRACKET] = SCANCODE_RBRACKET,
    [SDL_SCANCODE_RETURN] = SCANCODE_RETURN,
    [SDL_SCANCODE_LCTRL] = SCANCODE_LCONTROL,
    [SDL_SCANCODE_A] = SCANCODE_A,
    [SDL_SCANCODE_S] = SCANCODE_S,
    [SDL_SCANCODE_D] = SCANCODE_D,
    [SDL_SCANCODE_F] = SCANCODE_F,
    [SDL_SCANCODE_G] = SCANCODE_G,
    [SDL_SCANCODE_H] = SCANCODE_H,
    [SDL_SCANCODE_J] = SCANCODE_J,
    [SDL_SCANCODE_K] = SCANCODE_K,
    [SDL_SCANCODE_L] = SCANCODE_L,
    [SDL_SCANCODE_SEMICOLON] = SCANCODE_SEMICOLON,
    [SDL_SCANCODE_APOSTROPHE] = SCANCODE_APOSTROPHE,
    [SDL_SCANCODE_GRAVE] = SCANCODE_GRAVE,
    [SDL_SCANCODE_LSHIFT] = SCANCODE_LSHIFT,
    [SDL_SCANCODE_BACKSLASH] = SCANCODE_BACKSLASH,
    [SDL_SCANCODE_Z] = SCANCODE_Z,
    [SDL_SCANCODE_X] = SCANCODE_X,
    [SDL_SCANCODE_C] = SCANCODE_C,
    [SDL_SCANCODE_V] = SCANCODE_V,
    [SDL_SCANCODE_B] = SCANCODE_B,
    [SDL_SCANCODE_N] = SCANCODE_N,
    [SDL_SCANCODE_M] = SCANCODE_M,
    [SDL_SCANCODE_COMMA] = SCANCODE_COMMA,
    [SDL_SCANCODE_PERIOD] = SCANCODE_PERIOD,
    [SDL_SCANCODE_SLASH] = SCANCODE_SLASH,
    [SDL_SCANCODE_RSHIFT] = SCANCODE_RSHIFT,
    [SDL_SCANCODE_KP_MULTIPLY] = SCANCODE_MULTIPLY,
    [SDL_SCANCODE_LALT] = SCANCODE_LALT,
    [SDL_SCANCODE_SPACE] = SCANCODE_SPACE,
    [SDL_SCANCODE_CAPSLOCK] = SCANCODE_CAPITAL,
    [SDL_SCANCODE_F1] = SCANCODE_F1,
    [SDL_SCANCODE_F2] = SCANCODE_F2,
    [SDL_SCANCODE_F3] = SCANCODE_F3,
    [SDL_SCANCODE_F4] = SCANCODE_F4,
    [SDL_SCANCODE_F5] = SCANCODE_F5,
    [SDL_SCANCODE_F6] = SCANCODE_F6,
    [SDL_SCANCODE_F7] = SCANCODE_F7,
    [SDL_SCANCODE_F8] = SCANCODE_F8,
    [SDL_SCANCODE_F9] = SCANCODE_F9,
    [SDL_SCANCODE_F10] = SCANCODE_F10,
    [SDL_SCANCODE_NUMLOCKCLEAR] = SCANCODE_NUMLOCK,
    [SDL_SCANCODE_SCROLLLOCK] = SCANCODE_SCROLL,
    [SDL_SCANCODE_KP_7] = SCANCODE_NUMPAD7,
    [SDL_SCANCODE_KP_8] = SCANCODE_NUMPAD8,
    [SDL_SCANCODE_KP_9] = SCANCODE_NUMPAD9,
    [SDL_SCANCODE_KP_MINUS] = SCANCODE_SUBTRACT,
    [SDL_SCANCODE_KP_4] = SCANCODE_NUMPAD4,
    [SDL_SCANCODE_KP_5] = SCANCODE_NUMPAD5,
    [SDL_SCANCODE_KP_6] = SCANCODE_NUMPAD6,
    [SDL_SCANCODE_KP_PLUS] = SCANCODE_ADD,
    [SDL_SCANCODE_KP_1] = SCANCODE_NUMPAD1,
    [SDL_SCANCODE_KP_2] = SCANCODE_NUMPAD2,
    [SDL_SCANCODE_KP_3] = SCANCODE_NUMPAD3,
    [SDL_SCANCODE_KP_0] = SCANCODE_NUMPAD0,
    [SDL_SCANCODE_KP_PERIOD] = SCANCODE_DECIMAL,
    [SDL_SCANCODE_NONUSBACKSLASH] = SCANCODE_OEM_102,
    [SDL_SCANCODE_F11] = SCANCODE_F11,
    [SDL_SCANCODE_F12] = SCANCODE_F12,
    [SDL_SCANCODE_KP_ENTER] = SCANCODE_NUMPADENTER,
    [SDL_SCANCODE_RCTRL] = SCANCODE_RCONTROL,
    [SDL_SCANCODE_KP_DIVIDE] = SCANCODE_DIVIDE,
    [SDL_SCANCODE_RALT] = SCANCODE_RALT,
    [SDL_SCANCODE_PAUSE] = SCANCODE_PAUSE,
    [SDL_SCANCODE_HOME] = SCANCODE_HOME,
    [SDL_SCANCODE_UP] = SCANCODE_UP,
    [SDL_SCANCODE_PAGEUP] = SCANCODE_PGUP,
    [SDL_SCANCODE_LEFT] = SCANCODE_LEFT,
    [SDL_SCANCODE_RIGHT] = SCANCODE_RIGHT,
    [SDL_SCANCODE_END] = SCANCODE_END,
    [SDL_SCANCODE_DOWN] = SCANCODE_DOWN,
    [SDL_SCANCODE_PAGEDOWN] = SCANCODE_PGDN,
    [SDL_SCANCODE_INSERT] = SCANCODE_INSERT,
    [SDL_SCANCODE_DELETE] = SCANCODE_DELETE,
};

#endif /* _SDL2_SCANCODE_TO_DINPUT_H_ */
