#include "stdafx.h"
#include <map>
#include <unordered_map>

#include <SDL.h>

namespace ffmodule {

	SDL_Keycode GetKeycode(System::Windows::Forms::Keys key){
		switch (key)
		{
		case System::Windows::Forms::Keys::None:
			return SDLK_UNKNOWN;
		case System::Windows::Forms::Keys::Back:
			return SDLK_BACKSPACE;
		case System::Windows::Forms::Keys::Tab:
			return SDLK_TAB;
		case System::Windows::Forms::Keys::Clear:
			return SDLK_CLEAR;
		case System::Windows::Forms::Keys::Enter:
			return SDLK_RETURN;
		case System::Windows::Forms::Keys::ShiftKey:
			return SDLK_LSHIFT;
		case System::Windows::Forms::Keys::ControlKey:
			return SDLK_LCTRL;
		case System::Windows::Forms::Keys::Menu:
			return 	SDLK_LALT;
		case System::Windows::Forms::Keys::Pause:
			return SDLK_PAUSE;
		case System::Windows::Forms::Keys::CapsLock:
			return SDLK_CAPSLOCK;
		case System::Windows::Forms::Keys::Escape:
			return SDLK_ESCAPE;
		case System::Windows::Forms::Keys::Space:
			return 	SDLK_SPACE;
		case System::Windows::Forms::Keys::PageUp:
			return SDLK_PAGEUP;
		case System::Windows::Forms::Keys::PageDown:
			return SDLK_PAGEDOWN;
		case System::Windows::Forms::Keys::End:
			return SDLK_END;
		case System::Windows::Forms::Keys::Home:
			return SDLK_HOME;
		case System::Windows::Forms::Keys::Left:
			return SDLK_LEFT;
		case System::Windows::Forms::Keys::Up:
			return SDLK_UP;
		case System::Windows::Forms::Keys::Right:
			return SDLK_RIGHT;
		case System::Windows::Forms::Keys::Down:
			return SDLK_DOWN;
		case System::Windows::Forms::Keys::Select:
			return SDLK_SELECT;
		case System::Windows::Forms::Keys::PrintScreen:
			return SDLK_PRINTSCREEN;
		case System::Windows::Forms::Keys::Insert:
			return SDLK_INSERT;
		case System::Windows::Forms::Keys::Delete:
			return SDLK_DELETE;
		case System::Windows::Forms::Keys::Help:
			return SDLK_HELP;
		case System::Windows::Forms::Keys::D0:
			return SDLK_0;
		case System::Windows::Forms::Keys::D1:
			return SDLK_1;
		case System::Windows::Forms::Keys::D2:
			return SDLK_2;
		case System::Windows::Forms::Keys::D3:
			return SDLK_3;
		case System::Windows::Forms::Keys::D4:
			return SDLK_4;
		case System::Windows::Forms::Keys::D5:
			return SDLK_5;
		case System::Windows::Forms::Keys::D6:
			return SDLK_6;
		case System::Windows::Forms::Keys::D7:
			return SDLK_7;
		case System::Windows::Forms::Keys::D8:
			return SDLK_8;
		case System::Windows::Forms::Keys::D9:
			return SDLK_9;
		case System::Windows::Forms::Keys::A:
			return SDLK_a;
		case System::Windows::Forms::Keys::B:
			return SDLK_b;
		case System::Windows::Forms::Keys::C:
			return SDLK_c;
		case System::Windows::Forms::Keys::D:
			return SDLK_d;
		case System::Windows::Forms::Keys::E:
			return SDLK_e;
		case System::Windows::Forms::Keys::F:
			return SDLK_f;
		case System::Windows::Forms::Keys::G:
			return SDLK_g;
		case System::Windows::Forms::Keys::H:
			return SDLK_h;
		case System::Windows::Forms::Keys::I:
			return SDLK_i;
		case System::Windows::Forms::Keys::J:
			return SDLK_j;
		case System::Windows::Forms::Keys::K:
			return SDLK_k;
		case System::Windows::Forms::Keys::L:
			return SDLK_l;
		case System::Windows::Forms::Keys::M:
			return SDLK_m;
		case System::Windows::Forms::Keys::N:
			return SDLK_n;
		case System::Windows::Forms::Keys::O:
			return SDLK_o;
		case System::Windows::Forms::Keys::P:
			return SDLK_p;
		case System::Windows::Forms::Keys::Q:
			return SDLK_q;
		case System::Windows::Forms::Keys::R:
			return SDLK_r;
		case System::Windows::Forms::Keys::S:
			return SDLK_s;
		case System::Windows::Forms::Keys::T:
			return SDLK_t;
		case System::Windows::Forms::Keys::U:
			return SDLK_u;
		case System::Windows::Forms::Keys::V:
			return SDLK_v;
		case System::Windows::Forms::Keys::W:
			return SDLK_w;
		case System::Windows::Forms::Keys::X:
			return SDLK_x;
		case System::Windows::Forms::Keys::Y:
			return SDLK_y;
		case System::Windows::Forms::Keys::Z:
			return SDLK_z;
		case System::Windows::Forms::Keys::LWin:
			return SDLK_LGUI;
		case System::Windows::Forms::Keys::RWin:
			return SDLK_RGUI;
		case System::Windows::Forms::Keys::Apps:
			return SDLK_APPLICATION;
		case System::Windows::Forms::Keys::Sleep:
			return SDLK_SLEEP;
		case System::Windows::Forms::Keys::NumPad0:
			return SDLK_KP_0;
		case System::Windows::Forms::Keys::NumPad1:
			return SDLK_KP_1;
		case System::Windows::Forms::Keys::NumPad2:
			return SDLK_KP_2;
		case System::Windows::Forms::Keys::NumPad3:
			return SDLK_KP_3;
		case System::Windows::Forms::Keys::NumPad4:
			return SDLK_KP_4;
		case System::Windows::Forms::Keys::NumPad5:
			return SDLK_KP_5;
		case System::Windows::Forms::Keys::NumPad6:
			return SDLK_KP_6;
		case System::Windows::Forms::Keys::NumPad7:
			return SDLK_KP_7;
		case System::Windows::Forms::Keys::NumPad8:
			return SDLK_KP_8;
		case System::Windows::Forms::Keys::NumPad9:
			return SDLK_KP_9;
		case System::Windows::Forms::Keys::Multiply:
			return SDLK_KP_MULTIPLY;
		case System::Windows::Forms::Keys::Add:
			return SDLK_KP_PLUS;
		case System::Windows::Forms::Keys::Separator:
			return SDLK_KP_ENTER;
		case System::Windows::Forms::Keys::Subtract:
			return SDLK_KP_MINUS;
		case System::Windows::Forms::Keys::Decimal:
			return SDLK_KP_PERIOD;
		case System::Windows::Forms::Keys::Divide:
			return SDLK_KP_DIVIDE;
		case System::Windows::Forms::Keys::F1:
			return SDLK_F1;
		case System::Windows::Forms::Keys::F2:
			return SDLK_F2;
		case System::Windows::Forms::Keys::F3:
			return SDLK_F3;
		case System::Windows::Forms::Keys::F4:
			return SDLK_F4;
		case System::Windows::Forms::Keys::F5:
			return SDLK_F5;
		case System::Windows::Forms::Keys::F6:
			return SDLK_F6;
		case System::Windows::Forms::Keys::F7:
			return SDLK_F7;
		case System::Windows::Forms::Keys::F8:
			return SDLK_F8;
		case System::Windows::Forms::Keys::F9:
			return SDLK_F9;
		case System::Windows::Forms::Keys::F10:
			return SDLK_F10;
		case System::Windows::Forms::Keys::F11:
			return SDLK_F11;
		case System::Windows::Forms::Keys::F12:
			return SDLK_F12;
		case System::Windows::Forms::Keys::F13:
			return SDLK_F13;
		case System::Windows::Forms::Keys::F14:
			return SDLK_F14;
		case System::Windows::Forms::Keys::F15:
			return SDLK_F15;
		case System::Windows::Forms::Keys::F16:
			return SDLK_F16;
		case System::Windows::Forms::Keys::F17:
			return SDLK_F17;
		case System::Windows::Forms::Keys::F18:
			return SDLK_F18;
		case System::Windows::Forms::Keys::F19:
			return SDLK_F19;
		case System::Windows::Forms::Keys::F20:
			return SDLK_F20;
		case System::Windows::Forms::Keys::F21:
			return SDLK_F21;
		case System::Windows::Forms::Keys::F22:
			return SDLK_F22;
		case System::Windows::Forms::Keys::F23:
			return SDLK_F23;
		case System::Windows::Forms::Keys::F24:
			return SDLK_F24;
		case System::Windows::Forms::Keys::NumLock:
			return SDLK_NUMLOCKCLEAR;
		case System::Windows::Forms::Keys::Scroll:
			return SDLK_SCROLLLOCK;
		case System::Windows::Forms::Keys::LShiftKey:
			return SDLK_LSHIFT;
		case System::Windows::Forms::Keys::RShiftKey:
			return SDLK_RSHIFT;
		case System::Windows::Forms::Keys::LControlKey:
			return SDLK_LCTRL;
		case System::Windows::Forms::Keys::RControlKey:
			return SDLK_RCTRL;
		case System::Windows::Forms::Keys::LMenu:
			return SDLK_LALT;
		case System::Windows::Forms::Keys::RMenu:
			return SDLK_RALT;
		case System::Windows::Forms::Keys::BrowserBack:
			return SDLK_AC_BACK;
		case System::Windows::Forms::Keys::BrowserForward:
			return SDLK_AC_FORWARD;
		case System::Windows::Forms::Keys::BrowserRefresh:
			return SDLK_AC_REFRESH;
		case System::Windows::Forms::Keys::BrowserStop:
			return SDLK_AC_STOP;
		case System::Windows::Forms::Keys::BrowserSearch:
			return SDLK_AC_SEARCH;
		case System::Windows::Forms::Keys::BrowserFavorites:
			return SDLK_AC_BOOKMARKS;
		case System::Windows::Forms::Keys::BrowserHome:
			return SDLK_AC_HOME;
		case System::Windows::Forms::Keys::VolumeMute:
			return SDLK_MUTE;
		case System::Windows::Forms::Keys::VolumeDown:
			return SDLK_VOLUMEDOWN;
		case System::Windows::Forms::Keys::VolumeUp:
			return SDLK_VOLUMEUP;
		case System::Windows::Forms::Keys::MediaNextTrack:
			return SDLK_AUDIONEXT;
		case System::Windows::Forms::Keys::MediaPreviousTrack:
			return SDLK_AUDIOPREV;
		case System::Windows::Forms::Keys::MediaStop:
			return SDLK_AUDIOSTOP;
		case System::Windows::Forms::Keys::MediaPlayPause:
			return SDLK_AUDIOPLAY;
		case System::Windows::Forms::Keys::LaunchMail:
			return SDLK_MAIL;
		case System::Windows::Forms::Keys::SelectMedia:
			return SDLK_MEDIASELECT;
		case System::Windows::Forms::Keys::OemSemicolon:
			return SDLK_SEMICOLON;
		case System::Windows::Forms::Keys::Oemplus:
			return SDLK_EQUALS;
		case System::Windows::Forms::Keys::Oemcomma:
			return SDLK_COMMA;
		case System::Windows::Forms::Keys::OemMinus:
			return SDLK_MINUS;
		case System::Windows::Forms::Keys::OemPeriod:
			return SDLK_PERIOD;
		case System::Windows::Forms::Keys::OemQuestion:
			return SDLK_SLASH;
		case System::Windows::Forms::Keys::Oemtilde:
			return SDLK_BACKQUOTE;
		case System::Windows::Forms::Keys::OemOpenBrackets:
			return SDLK_LEFTBRACKET;
		case System::Windows::Forms::Keys::OemPipe:
			return SDLK_BACKSLASH;
		case System::Windows::Forms::Keys::OemCloseBrackets:
			return SDLK_RIGHTBRACKET;
		case System::Windows::Forms::Keys::OemQuotes:
			return SDLK_QUOTE;
		case System::Windows::Forms::Keys::Exsel:
			return SDLK_EXSEL;
		default:
			return SDLK_UNKNOWN;
		}
	};
}