//KeyObj

let KeyVaule=[
	VK_UP,     //忋
	VK_DOWN,   //壓
	VK_LEFT,   //嵍
	VK_RIGHT,  //塃
	//
	VK_SLOWMOVE,//掅懍堏摦
	VK_SHOT,    //幩寕
	VK_BOMB,    //Bomb
	VK_USER,    //巊梡幰擟堄掕媊
	VK_SKIP,    //挼夁洈榖
	];

let KeyStatus=[
	KEY_FREE, //擟堦尞曻奐
	KEY_PUSH, //埪壓揑弖娫
	KEY_HOLD, //堦捈埪廧揑?懺
	KEY_PULL, //曻奐揑弖娫
	];
	
//Sys儗僶乕
let PUp    = false;
let PDown  = false;
let PLeft  = false;
let PRight = false;

//曽岦儗僶乕
let Up    = false;
let Down  = false;
let Left  = false;
let Right = false;

//儃僞儞
let NoSlow   = false;
let KeySlow  = false;
let RapSlow  = false;
let ResSlow  = false;

//幩寕
let NoShot   = false;
let KeyShot  = false;
let RapShot  = false;
let ResShot  = false;

//儃儉
let NoBomb   = false;
let KeyBomb  = false;
let RapBomb  = false;
let ResBomb  = false;

let NoUser   = false;
let User     = false;
let RapUser  = false;
let ResUser  = false;

let NoSkip   = false;
let Skip     = false;
let RapSkip  = false;
let ResSkip  = false;

task KeyCheck{
	loop{
		//Sys儗僶乕
		PUp    =GetKeyState(KeyVaule[0])==KeyStatus[1];
		PDown  =GetKeyState(KeyVaule[1])==KeyStatus[1];
		PLeft  =GetKeyState(KeyVaule[2])==KeyStatus[1];
		PRight =GetKeyState(KeyVaule[3])==KeyStatus[1];
		//曽岦儗僶乕
		Up     =GetKeyState(KeyVaule[0])==KeyStatus[2];
		Down   =GetKeyState(KeyVaule[1])==KeyStatus[2];
		Left   =GetKeyState(KeyVaule[2])==KeyStatus[2];
		Right  =GetKeyState(KeyVaule[3])==KeyStatus[2];
		//儃僞儞
		NoSlow =GetKeyState(KeyVaule[4])==KeyStatus[0];
		KeySlow=GetKeyState(KeyVaule[4])==KeyStatus[1];
		RapSlow=GetKeyState(KeyVaule[4])==KeyStatus[2];//楢幩
		ResSlow=GetKeyState(KeyVaule[4])==KeyStatus[3];//棴傔寕偪
		//幩寕
		NoShot =GetKeyState(KeyVaule[5])==KeyStatus[0];
		KeyShot=GetKeyState(KeyVaule[5])==KeyStatus[1];//僔儑僢僩
		RapShot=GetKeyState(KeyVaule[5])==KeyStatus[2];//楢幩(Rapid)
		ResShot=GetKeyState(KeyVaule[5])==KeyStatus[3];//棴傔寕偪(Reservoir)
		//儃儉
		NoBomb =GetKeyState(KeyVaule[6])==KeyStatus[0];
		KeyBomb=GetKeyState(KeyVaule[6])==KeyStatus[1];
		RapBomb=GetKeyState(KeyVaule[6])==KeyStatus[2];
		ResBomb=GetKeyState(KeyVaule[6])==KeyStatus[3];//棴傔寕偪
		
		NoUser =GetKeyState(KeyVaule[7])==KeyStatus[0];
		User   =GetKeyState(KeyVaule[7])==KeyStatus[1];
		RapUser=GetKeyState(KeyVaule[7])==KeyStatus[2];
		ResUser=GetKeyState(KeyVaule[7])==KeyStatus[3];
		
		NoSkip =GetKeyState(KeyVaule[8])==KeyStatus[0];
		Skip   =GetKeyState(KeyVaule[8])==KeyStatus[1];
		RapSkip=GetKeyState(KeyVaule[8])==KeyStatus[2];
		ResSkip=GetKeyState(KeyVaule[8])==KeyStatus[3];
		
		yield;
	}
}
