#ifndef SVK_KEY_CONVERTER_HPP
#define SVK_KEY_CONVERTER_HPP

#include <unordered_map>
#include <string>
#include <SDL_scancode.h>
std::unordered_map<std::string, SDL_Scancode> _SimpleVulkanToSDLKeyTable = 
{
    {"a", SDL_SCANCODE_A},
    {"b", SDL_SCANCODE_B},
    {"c", SDL_SCANCODE_C},
    {"d", SDL_SCANCODE_D},
    {"e", SDL_SCANCODE_E},
    {"f", SDL_SCANCODE_F},
    {"g", SDL_SCANCODE_G},
    {"h", SDL_SCANCODE_H},
    {"i", SDL_SCANCODE_I},
    {"j", SDL_SCANCODE_J},
    {"k", SDL_SCANCODE_K},
    {"l", SDL_SCANCODE_L},
    {"m", SDL_SCANCODE_M},
    {"n", SDL_SCANCODE_N},
    {"o", SDL_SCANCODE_O},
    {"p", SDL_SCANCODE_P},
    {"q", SDL_SCANCODE_Q},
    {"r", SDL_SCANCODE_R},
    {"s", SDL_SCANCODE_S},
    {"t", SDL_SCANCODE_T},
    {"u", SDL_SCANCODE_U},
    {"v", SDL_SCANCODE_V},
    {"w", SDL_SCANCODE_W},
    {"x", SDL_SCANCODE_X},
    {"y", SDL_SCANCODE_Y},

    {"0", SDL_SCANCODE_0},
    {"1", SDL_SCANCODE_1},
    {"2", SDL_SCANCODE_2},
    {"3", SDL_SCANCODE_3},
    {"4", SDL_SCANCODE_4},
    {"5", SDL_SCANCODE_5},
    {"6", SDL_SCANCODE_6},
    {"7", SDL_SCANCODE_7},
    {"8", SDL_SCANCODE_8},
    {"9", SDL_SCANCODE_9},

    
    {"F1", SDL_SCANCODE_F1},
    {"F2", SDL_SCANCODE_F2},
    {"F3", SDL_SCANCODE_F3},
    {"F4", SDL_SCANCODE_F4},
    {"F5", SDL_SCANCODE_F5},
    {"F6", SDL_SCANCODE_F6},
    {"F7", SDL_SCANCODE_F7},
    {"F8", SDL_SCANCODE_F8},
    {"F9", SDL_SCANCODE_F9},
    {"F10", SDL_SCANCODE_F10},
    {"F11", SDL_SCANCODE_F11},
    {"F12", SDL_SCANCODE_F12},

    {"return", SDL_SCANCODE_RETURN},
    {"escape", SDL_SCANCODE_ESCAPE},
    {"backspace", SDL_SCANCODE_BACKSPACE},
    {"tab", SDL_SCANCODE_TAB},
    {"space", SDL_SCANCODE_SPACE},

    {"comma", SDL_SCANCODE_COMMA},
    {"period", SDL_SCANCODE_PERIOD},

    {"capslock", SDL_SCANCODE_CAPSLOCK},

    {"shift", SDL_SCANCODE_LSHIFT},
    {"ctrl", SDL_SCANCODE_LCTRL},
    {"rctrl", SDL_SCANCODE_RCTRL},
};

std::unordered_map<std::string, std::string> _specialKeyConversionTable =
{
    {"control", "ctrl"},
    {"enter", "return"},
    {" ", "space"},
    {",", "comma"},
    {".", "period"},
    {"dot", "period"},
    {"caps", "capslock"},
    {"caps lock", "capslock"},
};

std::string _handleSpecialKeys(std::string const &key)
{
    if (_specialKeyConversionTable.contains(key))
        return _specialKeyConversionTable[key];
    return key;
}

#endif // SVK_KEY_CONVERTER_HPP