#include "input.h"

FFTInput::FFTInput()
{
	FFTKEY_fire1=SDLK_LCTRL;
	FFTKEY_fire2=SDLK_RCTRL;
	FFTKEY_warp1=SDLK_LALT;
	FFTKEY_warp2=SDLK_RALT;
	FFTKEY_up=SDLK_UP;
	FFTKEY_down=SDLK_DOWN;
	FFTKEY_left=SDLK_LEFT;
	FFTKEY_right=SDLK_RIGHT;
	FFTKEY_allstop=SDLK_SPACE;
	FFTKEY_cancel=SDLK_ESCAPE;
	FFTKEY_minimapzoomin=SDLK_KP_PLUS;
	FFTKEY_minimapzoomout=SDLK_KP_MINUS;
	FFTKEY_pause=SDLK_p;
	FFTKEY_zoomin=SDLK_z;
	FFTKEY_zoomout=SDLK_x;
	FFTKEY_prevweapon=SDLK_SLASH;
	FFTKEY_nextweapon=SDLK_RSHIFT;
	FFTKEY_dock=SDLK_d;
	FFTKEY_prevtarget=SDLK_r;
	FFTKEY_nexttarget=SDLK_t;
}
int FFTInput::GetFire1()
{
	return FFTKEY_fire1;
}
int FFTInput::GetFire2()
{
	return FFTKEY_fire2;
}
int FFTInput::GetWarp1()
{
	return FFTKEY_warp1;
}
int FFTInput::GetWarp2()
{
	return FFTKEY_warp2;
}
int FFTInput::GetUp()
{
	return FFTKEY_up;
}
int FFTInput::GetDown()
{
	return FFTKEY_down;
}
int FFTInput::GetLeft()
{
	return FFTKEY_left;
}
int FFTInput::GetRight()
{
	return FFTKEY_right;
}
int FFTInput::GetAllStop()
{
	return FFTKEY_allstop;
}
int FFTInput::GetCancel()
{
	return FFTKEY_cancel;
}
int FFTInput::GetMiniMapZoomIn()
{
	return FFTKEY_minimapzoomin;
}
int FFTInput::GetMiniMapZoomOut()
{
	return FFTKEY_minimapzoomout;
}
int FFTInput::GetPause()
{
	return FFTKEY_pause;
}
int FFTInput::GetZoomIn()
{
	return FFTKEY_zoomin;
}
int FFTInput::GetZoomOut()
{
	return FFTKEY_zoomout;
}
int FFTInput::GetPrevWeapon()
{
	return FFTKEY_prevweapon;
}
int FFTInput::GetNextWeapon()
{
	return FFTKEY_nextweapon;
}
int FFTInput::GetDock()
{
	return FFTKEY_dock;
}
int FFTInput::GetPrevTarget()
{
	return FFTKEY_prevtarget;
}
int FFTInput::GetNextTarget()
{
	return FFTKEY_nexttarget;
}
std::string FFTInput::GetFire1Str()
{
	return KeyCodeToString(FFTKEY_fire1);
}
std::string FFTInput::GetFire2Str()
{
	return KeyCodeToString(FFTKEY_fire2);
}
std::string FFTInput::GetWarp1Str()
{
	return KeyCodeToString(FFTKEY_warp1);
}
std::string FFTInput::GetWarp2Str()
{
	return KeyCodeToString(FFTKEY_warp2);
}
std::string FFTInput::GetUpStr()
{
	return KeyCodeToString(FFTKEY_up);
}
std::string FFTInput::GetDownStr()
{
	return KeyCodeToString(FFTKEY_down);
}
std::string FFTInput::GetLeftStr()
{
	return KeyCodeToString(FFTKEY_left);
}
std::string FFTInput::GetRightStr()
{
	return KeyCodeToString(FFTKEY_right);
}
std::string FFTInput::GetAllStopStr()
{
	return KeyCodeToString(FFTKEY_allstop);
}
std::string FFTInput::GetCancelStr()
{
	return KeyCodeToString(FFTKEY_cancel);
}
std::string FFTInput::GetMiniMapZoomInStr()
{
	return KeyCodeToString(FFTKEY_minimapzoomin);
}
std::string FFTInput::GetMiniMapZoomOutStr()
{
	return KeyCodeToString(FFTKEY_minimapzoomout);
}
std::string FFTInput::GetPauseStr()
{
	return KeyCodeToString(FFTKEY_pause);
}
std::string FFTInput::GetZoomInStr()
{
	return KeyCodeToString(FFTKEY_zoomin);
}
std::string FFTInput::GetZoomOutStr()
{
	return KeyCodeToString(FFTKEY_zoomout);
}
std::string FFTInput::GetPrevWeaponStr()
{
	return KeyCodeToString(FFTKEY_prevweapon);
}
std::string FFTInput::GetNextWeaponStr()
{
	return KeyCodeToString(FFTKEY_nextweapon);
}
std::string FFTInput::GetDockStr()
{
	return KeyCodeToString(FFTKEY_dock);
}
std::string FFTInput::GetPrevTargetStr()
{
	return KeyCodeToString(FFTKEY_prevtarget);
}
std::string FFTInput::GetNextTargetStr()
{
	return KeyCodeToString(FFTKEY_nexttarget);
}
void FFTInput::SetFire1(int sdlKeyCode)
{
	FFTKEY_fire1=sdlKeyCode;
}
void FFTInput::SetFire2(int sdlKeyCode)
{
	FFTKEY_fire2=sdlKeyCode;
}
void FFTInput::SetWarp1(int sdlKeyCode)
{
	FFTKEY_warp1=sdlKeyCode;
}
void FFTInput::SetWarp2(int sdlKeyCode)
{
	FFTKEY_warp2=sdlKeyCode;
}
void FFTInput::SetUp(int sdlKeyCode)
{
	FFTKEY_up=sdlKeyCode;
}
void FFTInput::SetDown(int sdlKeyCode)
{
	FFTKEY_down=sdlKeyCode;
}
void FFTInput::SetLeft(int sdlKeyCode)
{
	FFTKEY_left=sdlKeyCode;
}
void FFTInput::SetRight(int sdlKeyCode)
{
	FFTKEY_right=sdlKeyCode;
}
void FFTInput::SetAllStop(int sdlKeyCode)
{
	FFTKEY_allstop=sdlKeyCode;
}
void FFTInput::SetCancel(int sdlKeyCode)
{
	FFTKEY_cancel=sdlKeyCode;
}
void FFTInput::SetMiniMapZoomIn(int sdlKeyCode)
{
	FFTKEY_minimapzoomin=sdlKeyCode;
}
void FFTInput::SetMiniMapZoomOut(int sdlKeyCode)
{
	FFTKEY_minimapzoomout=sdlKeyCode;
}
void FFTInput::SetPause(int sdlKeyCode)
{
	FFTKEY_pause=sdlKeyCode;
}
void FFTInput::SetZoomIn(int sdlKeyCode)
{
	FFTKEY_zoomin=sdlKeyCode;
}
void FFTInput::SetZoomOut(int sdlKeyCode)
{
	FFTKEY_zoomout=sdlKeyCode;
}
void FFTInput::SetPrevWeapon(int sdlKeyCode)
{
	FFTKEY_prevweapon=sdlKeyCode;
}
void FFTInput::SetNextWeapon(int sdlKeyCode)
{
	FFTKEY_nextweapon=sdlKeyCode;
}
void FFTInput::SetDock(int sdlKeyCode)
{
	FFTKEY_dock=sdlKeyCode;
}
void FFTInput::SetPrevTarget(int sdlKeyCode)
{
	FFTKEY_prevtarget=sdlKeyCode;
}
void FFTInput::SetNextTarget(int sdlKeyCode)
{
	FFTKEY_nexttarget=sdlKeyCode;
}
bool FFTInput::KeyInUse(int sdlKeyCode)
{
	if (sdlKeyCode==FFTKEY_fire1) return true;
	else if (sdlKeyCode==FFTKEY_fire2) return true;
	else if (sdlKeyCode==FFTKEY_warp1) return true;
	else if (sdlKeyCode==FFTKEY_warp2) return true;
	else if (sdlKeyCode==FFTKEY_up) return true;
	else if (sdlKeyCode==FFTKEY_down) return true;
	else if (sdlKeyCode==FFTKEY_left) return true;
	else if (sdlKeyCode==FFTKEY_right) return true;
	else if (sdlKeyCode==FFTKEY_allstop) return true;
	else if (sdlKeyCode==FFTKEY_cancel) return true;
	else if (sdlKeyCode==FFTKEY_minimapzoomin) return true;
	else if (sdlKeyCode==FFTKEY_minimapzoomout) return true;
	else if (sdlKeyCode==FFTKEY_pause) return true;
	else if (sdlKeyCode==FFTKEY_zoomin) return true;
	else if (sdlKeyCode==FFTKEY_zoomout) return true;
	else if (sdlKeyCode==FFTKEY_prevweapon) return true;
	else if (sdlKeyCode==FFTKEY_nextweapon) return true;
	else if (sdlKeyCode==FFTKEY_dock) return true;
	else if (sdlKeyCode==FFTKEY_prevtarget) return true;
	else if (sdlKeyCode==FFTKEY_nexttarget) return true;
	else return false;
}
std::string FFTInput::KeyCodeToString(int sdlKeyCode)
{
	std::string key;
	switch(sdlKeyCode)
	{
		case SDLK_BACKSPACE: key="backspace"; break;
		case SDLK_TAB: key="TAB"; break;
		case SDLK_CLEAR: key="Clear"; break;
		case SDLK_RETURN: key="ENTER"; break;
		case SDLK_PAUSE: key="pause"; break;
		case SDLK_ESCAPE: key="escape"; break;
		case SDLK_SPACE: key="space"; break;
		case SDLK_EXCLAIM: key="!"; break;
		case SDLK_QUOTEDBL: key="\"\""; break;
		case SDLK_HASH: key="#"; break;
		case SDLK_DOLLAR: key="$"; break;
		case SDLK_AMPERSAND: key="&"; break;
		case SDLK_QUOTE: key="\""; break;
		case SDLK_ASTERISK: key="*"; break;
		case SDLK_PLUS: key="+"; break;
		case SDLK_COMMA: key=","; break;
		case SDLK_MINUS: key="-"; break;
		case SDLK_PERIOD: key="."; break;
		case SDLK_SLASH: key="/"; break;
		case SDLK_0: key="0"; break;
		case SDLK_1: key="1"; break;
		case SDLK_2: key="2"; break;
		case SDLK_3: key="3"; break;
		case SDLK_4: key="4"; break;
		case SDLK_5: key="5"; break;
		case SDLK_6: key="6"; break;
		case SDLK_7: key="7"; break;
		case SDLK_8: key="8"; break;
		case SDLK_9: key="9"; break;
		case SDLK_COLON: key=":"; break;
		case SDLK_SEMICOLON: key=";"; break;
		case SDLK_LESS: key="<"; break;
		case SDLK_EQUALS: key="="; break;
		case SDLK_GREATER: key=">"; break;
		case SDLK_QUESTION: key="?"; break;
		case SDLK_AT: key="@"; break;
		case SDLK_LEFTBRACKET: key="["; break;
		case SDLK_BACKSLASH: key="\\"; break;
		case SDLK_RIGHTBRACKET: key="]"; break;
		case SDLK_CARET: key="^"; break;
		case SDLK_UNDERSCORE: key="_"; break;
		case SDLK_BACKQUOTE: key="`"; break;
		case SDLK_a: key="a"; break;
		case SDLK_b: key="b"; break;
		case SDLK_c: key="c"; break;
		case SDLK_d: key="d"; break;
		case SDLK_e: key="e"; break;
		case SDLK_f: key="f"; break;
		case SDLK_g: key="g"; break;
		case SDLK_h: key="h"; break;
		case SDLK_i: key="i"; break;
		case SDLK_j: key="j"; break;
		case SDLK_k: key="k"; break;
		case SDLK_l: key="l"; break;
		case SDLK_m: key="m"; break;
		case SDLK_n: key="n"; break;
		case SDLK_o: key="o"; break;
		case SDLK_p: key="p"; break;
		case SDLK_q: key="q"; break;
		case SDLK_r: key="r"; break;
		case SDLK_s: key="s"; break;
		case SDLK_t: key="t"; break;
		case SDLK_u: key="u"; break;
		case SDLK_v: key="v"; break;
		case SDLK_w: key="w"; break;
		case SDLK_x: key="x"; break;
		case SDLK_y: key="y"; break;
		case SDLK_z: key="z"; break;
		case SDLK_DELETE: key="delete"; break;
		case SDLK_KP0: key="keypad 0"; break;
		case SDLK_KP1: key="keypad 1"; break;
		case SDLK_KP2: key="keypad 2"; break;
		case SDLK_KP3: key="keypad 3"; break;
		case SDLK_KP4: key="keypad 4"; break;
		case SDLK_KP5: key="keypad 5"; break;
		case SDLK_KP6: key="keypad 6"; break;
		case SDLK_KP7: key="keypad 7"; break;
		case SDLK_KP8: key="keypad 8"; break;
		case SDLK_KP9: key="keypad 9"; break;
		case SDLK_KP_PERIOD: key="keypad ."; break;
		case SDLK_KP_DIVIDE: key="keypad /"; break;
		case SDLK_KP_MULTIPLY: key="keypad *"; break;
		case SDLK_KP_MINUS: key="keypad -"; break;
		case SDLK_KP_PLUS: key="keypad +"; break;
		case SDLK_KP_ENTER: key="keypad enter"; break;
		case SDLK_KP_EQUALS: key="keypad ="; break;
		case SDLK_UP: key="up"; break;
		case SDLK_DOWN: key="down"; break;
		case SDLK_RIGHT: key="right"; break;
		case SDLK_LEFT: key="left"; break;
		case SDLK_INSERT: key="insert"; break;
		case SDLK_HOME: key="home"; break;
		case SDLK_END: key="end"; break;
		case SDLK_PAGEUP: key="page up"; break;
		case SDLK_PAGEDOWN: key="page down"; break;
		case SDLK_F1: key="F1"; break;
		case SDLK_F2: key="F2"; break;
		case SDLK_F3: key="F3"; break;
		case SDLK_F4: key="F4"; break;
		case SDLK_F5: key="F5"; break;
		case SDLK_F6: key="F6"; break;
		case SDLK_F7: key="F7"; break;
		case SDLK_F8: key="F8"; break;
		case SDLK_F9: key="F9"; break;
		case SDLK_F10: key="F10"; break;
		case SDLK_F11: key="F11"; break;
		case SDLK_F12: key="F12"; break;
		case SDLK_F13: key="F13"; break;
		case SDLK_F14: key="F14"; break;
		case SDLK_F15: key="F15"; break;
		case SDLK_NUMLOCK: key="numlock"; break;
		case SDLK_CAPSLOCK: key="capslock"; break;
		case SDLK_SCROLLOCK: key="scrollock"; break;
		case SDLK_RSHIFT: key="right shift"; break;
		case SDLK_LSHIFT: key="left shift"; break;
		case SDLK_RCTRL: key="right ctrl"; break;
		case SDLK_LCTRL: key="left ctrl"; break;
		case SDLK_RALT: key="right alt"; break;
		case SDLK_LALT: key="left alt"; break;
		case SDLK_RMETA: key="right meta"; break;
		case SDLK_LMETA: key="left meta"; break;
		case SDLK_LSUPER: key="left windows key"; break;
		case SDLK_RSUPER: key="right windows key"; break;
		case SDLK_MODE: key="mode shift"; break;
		case SDLK_HELP: key="help"; break;
		case SDLK_PRINT: key="print-screen"; break;
		case SDLK_SYSREQ: key="SysRq"; break;
		case SDLK_BREAK: key="break"; break;
		case SDLK_MENU: key="menu"; break;
		case SDLK_POWER: key="power"; break;
		case SDLK_EURO: key="euro"; break;
	}
	return key;
}
int FFTInput::StringToKeyCode(std::string str)
{
	int key=0;
	if (!strcmp(str.c_str(),"backspace")) key=SDLK_BACKSPACE;
	if(!strcmp(str.c_str(),"TAB")) key=SDLK_TAB;
	if(!strcmp(str.c_str(),"Clear")) key=SDLK_CLEAR;
	if(!strcmp(str.c_str(),"ENTER")) key=SDLK_RETURN;
	if(!strcmp(str.c_str(),"pause")) key=SDLK_PAUSE;
	if(!strcmp(str.c_str(),"escape")) key=SDLK_ESCAPE;
	if(!strcmp(str.c_str(),"space")) key=SDLK_SPACE;
	if(!strcmp(str.c_str(),"!")) key=SDLK_EXCLAIM;
	if(!strcmp(str.c_str(),"\"\"")) key=SDLK_QUOTEDBL;
	if(!strcmp(str.c_str(),"#")) key=SDLK_HASH;
	if(!strcmp(str.c_str(),"$")) key=SDLK_DOLLAR;
	if(!strcmp(str.c_str(),"&")) key=SDLK_AMPERSAND;
	if(!strcmp(str.c_str(),"\"")) key=SDLK_QUOTE;
	if(!strcmp(str.c_str(),"*")) key=SDLK_ASTERISK;
	if(!strcmp(str.c_str(),"+")) key=SDLK_PLUS;
	if(!strcmp(str.c_str(),",")) key=SDLK_COMMA;
	if(!strcmp(str.c_str(),"-")) key=SDLK_MINUS;
	if(!strcmp(str.c_str(),".")) key=SDLK_PERIOD;
	if(!strcmp(str.c_str(),"/")) key=SDLK_SLASH;
	if(!strcmp(str.c_str(),"0")) key=SDLK_0;
	if(!strcmp(str.c_str(),"1")) key=SDLK_1;
	if(!strcmp(str.c_str(),"2")) key=SDLK_2;
	if(!strcmp(str.c_str(),"3")) key=SDLK_3;
	if(!strcmp(str.c_str(),"4")) key=SDLK_4;
	if(!strcmp(str.c_str(),"5")) key=SDLK_5;
	if(!strcmp(str.c_str(),"6")) key=SDLK_6;
	if(!strcmp(str.c_str(),"7")) key=SDLK_7;
	if(!strcmp(str.c_str(),"8")) key=SDLK_8;
	if(!strcmp(str.c_str(),"9")) key=SDLK_9;
	if(!strcmp(str.c_str(),":")) key=SDLK_COLON;
	if(!strcmp(str.c_str(),";")) key=SDLK_SEMICOLON;
	if(!strcmp(str.c_str(),"<")) key=SDLK_LESS;
	if(!strcmp(str.c_str(),"=")) key=SDLK_EQUALS;
	if(!strcmp(str.c_str(),">")) key=SDLK_GREATER;
	if(!strcmp(str.c_str(),"?")) key=SDLK_QUESTION;
	if(!strcmp(str.c_str(),"@")) key=SDLK_AT;
	if(!strcmp(str.c_str(),"[")) key=SDLK_LEFTBRACKET;
	if(!strcmp(str.c_str(),"\\")) key=SDLK_BACKSLASH;
	if(!strcmp(str.c_str(),"]")) key=SDLK_RIGHTBRACKET;
	if(!strcmp(str.c_str(),"^")) key=SDLK_CARET;
	if(!strcmp(str.c_str(),"_")) key=SDLK_UNDERSCORE;
	if(!strcmp(str.c_str(),"`")) key=SDLK_BACKQUOTE;
	if(!strcmp(str.c_str(),"a")) key=SDLK_a;
	if(!strcmp(str.c_str(),"b")) key=SDLK_b;
	if(!strcmp(str.c_str(),"c")) key=SDLK_c;
	if(!strcmp(str.c_str(),"d")) key=SDLK_d;
	if(!strcmp(str.c_str(),"e")) key=SDLK_e;
	if(!strcmp(str.c_str(),"f")) key=SDLK_f;
	if(!strcmp(str.c_str(),"g")) key=SDLK_g;
	if(!strcmp(str.c_str(),"h")) key=SDLK_h;
	if(!strcmp(str.c_str(),"i")) key=SDLK_i;
	if(!strcmp(str.c_str(),"j")) key=SDLK_j;
	if(!strcmp(str.c_str(),"k")) key=SDLK_k;
	if(!strcmp(str.c_str(),"l")) key=SDLK_l;
	if(!strcmp(str.c_str(),"m")) key=SDLK_m;
	if(!strcmp(str.c_str(),"n")) key=SDLK_n;
	if(!strcmp(str.c_str(),"o")) key=SDLK_o;
	if(!strcmp(str.c_str(),"p")) key=SDLK_p;
	if(!strcmp(str.c_str(),"q")) key=SDLK_q;
	if(!strcmp(str.c_str(),"r")) key=SDLK_r;
	if(!strcmp(str.c_str(),"s")) key=SDLK_s;
	if(!strcmp(str.c_str(),"t")) key=SDLK_t;
	if(!strcmp(str.c_str(),"u")) key=SDLK_u;
	if(!strcmp(str.c_str(),"v")) key=SDLK_v;
	if(!strcmp(str.c_str(),"w")) key=SDLK_w;
	if(!strcmp(str.c_str(),"x")) key=SDLK_x;
	if(!strcmp(str.c_str(),"y")) key=SDLK_y;
	if(!strcmp(str.c_str(),"z")) key=SDLK_z;
	if(!strcmp(str.c_str(),"delete")) key=SDLK_DELETE;
	if(!strcmp(str.c_str(),"keypad 0")) key=SDLK_KP0;
	if(!strcmp(str.c_str(),"keypad 1")) key=SDLK_KP1;
	if(!strcmp(str.c_str(),"keypad 2")) key=SDLK_KP2;
	if(!strcmp(str.c_str(),"keypad 3")) key=SDLK_KP3;
	if(!strcmp(str.c_str(),"keypad 4")) key=SDLK_KP4;
	if(!strcmp(str.c_str(),"keypad 5")) key=SDLK_KP5;
	if(!strcmp(str.c_str(),"keypad 6")) key=SDLK_KP6;
	if(!strcmp(str.c_str(),"keypad 7")) key=SDLK_KP7;
	if(!strcmp(str.c_str(),"keypad 8")) key=SDLK_KP8;
	if(!strcmp(str.c_str(),"keypad 9")) key=SDLK_KP9;
	if(!strcmp(str.c_str(),"keypad .")) key=SDLK_KP_PERIOD;
	if(!strcmp(str.c_str(),"keypad /")) key=SDLK_KP_DIVIDE;
	if(!strcmp(str.c_str(),"keypad *")) key=SDLK_KP_MULTIPLY;
	if(!strcmp(str.c_str(),"keypad -")) key=SDLK_KP_MINUS;
	if(!strcmp(str.c_str(),"keypad +")) key=SDLK_KP_PLUS;
	if(!strcmp(str.c_str(),"keypad enter")) key=SDLK_KP_ENTER;
	if(!strcmp(str.c_str(),"keypad =")) key=SDLK_KP_EQUALS;
	if(!strcmp(str.c_str(),"up")) key=SDLK_UP;
	if(!strcmp(str.c_str(),"down")) key=SDLK_DOWN;
	if(!strcmp(str.c_str(),"right")) key=SDLK_RIGHT;
	if(!strcmp(str.c_str(),"left")) key=SDLK_LEFT;
	if(!strcmp(str.c_str(),"insert")) key=SDLK_INSERT;
	if(!strcmp(str.c_str(),"home")) key=SDLK_HOME;
	if(!strcmp(str.c_str(),"end")) key=SDLK_END;
	if(!strcmp(str.c_str(),"page up")) key=SDLK_PAGEUP;
	if(!strcmp(str.c_str(),"page down")) key=SDLK_PAGEDOWN;
	if(!strcmp(str.c_str(),"F1")) key=SDLK_F1;
	if(!strcmp(str.c_str(),"F2")) key=SDLK_F2;
	if(!strcmp(str.c_str(),"F3")) key=SDLK_F3;
	if(!strcmp(str.c_str(),"F4")) key=SDLK_F4;
	if(!strcmp(str.c_str(),"F5")) key=SDLK_F5;
	if(!strcmp(str.c_str(),"F6")) key=SDLK_F6;
	if(!strcmp(str.c_str(),"F7")) key=SDLK_F7;
	if(!strcmp(str.c_str(),"F8")) key=SDLK_F8;
	if(!strcmp(str.c_str(),"F9")) key=SDLK_F9;
	if(!strcmp(str.c_str(),"F10")) key=SDLK_F10;
	if(!strcmp(str.c_str(),"F11")) key=SDLK_F11;
	if(!strcmp(str.c_str(),"F12")) key=SDLK_F12;
	if(!strcmp(str.c_str(),"F13")) key=SDLK_F13;
	if(!strcmp(str.c_str(),"F14")) key=SDLK_F14;
	if(!strcmp(str.c_str(),"F15")) key=SDLK_F15;
	if(!strcmp(str.c_str(),"numlock")) key=SDLK_NUMLOCK;
	if(!strcmp(str.c_str(),"capslock")) key=SDLK_CAPSLOCK;
	if(!strcmp(str.c_str(),"scrollock")) key=SDLK_SCROLLOCK;
	if(!strcmp(str.c_str(),"right shift")) key=SDLK_RSHIFT;
	if(!strcmp(str.c_str(),"left shift")) key=SDLK_LSHIFT;
	if(!strcmp(str.c_str(),"right ctrl")) key=SDLK_RCTRL;
	if(!strcmp(str.c_str(),"left ctrl")) key=SDLK_LCTRL;
	if(!strcmp(str.c_str(),"right alt")) key=SDLK_RALT;
	if(!strcmp(str.c_str(),"left alt")) key=SDLK_LALT;
	if(!strcmp(str.c_str(),"right meta")) key=SDLK_RMETA;
	if(!strcmp(str.c_str(),"left meta")) key=SDLK_LMETA;
	if(!strcmp(str.c_str(),"left windows key")) key=SDLK_LSUPER;
	if(!strcmp(str.c_str(),"right windows key")) key=SDLK_RSUPER;
	if(!strcmp(str.c_str(),"mode shift")) key=SDLK_MODE;
	if(!strcmp(str.c_str(),"help")) key=SDLK_HELP;
	if(!strcmp(str.c_str(),"print-screen")) key=SDLK_PRINT;
	if(!strcmp(str.c_str(),"SysRq")) key=SDLK_SYSREQ;
	if(!strcmp(str.c_str(),"break")) key=SDLK_BREAK;
	if(!strcmp(str.c_str(),"menu")) key=SDLK_MENU;
	if(!strcmp(str.c_str(),"power")) key=SDLK_POWER;
	if(!strcmp(str.c_str(),"euro")) key=SDLK_EURO;
	return key;
}


