--key_count関数：実行部：マイクロスレッド内に置いて使用
--2014.07.10 一応完成

--キー入力周りのカウント変数のグローバル変数宣言
en_keymap2_up = 0
en_keymap2_down = 0
en_keymap2_left = 0
en_keymap2_right = 0
en_keymap2_a = 0
en_keymap2_b = 0
en_keymap2_c = 0
en_keymap2_d = 0
en_keymap2_ab = 0
en_keymap2_bc = 0
en_keymap2_uleft = 0
en_keymap2_uright = 0
en_keymap2_dleft = 0
en_keymap2_dright = 0

en_keyon_up_count = 0
en_keyon_down_count = 0
en_keyon_left_count = 0
en_keyon_right_count = 0
en_keyon_a_count = 0
en_keyon_b_count = 0
en_keyon_c_count = 0
en_keyon_d_count = 0
en_keyon_ab_count = 0
en_keyon_bc_count = 0
en_keyon_uleft_count = 0
en_keyon_uright_count = 0
en_keyon_dleft_count = 0
en_keyon_dright_count = 0
en_keyon_neutral_count = 0

en_keyoff_up_count = 0
en_keyoff_down_count = 0
en_keyoff_left_count = 0
en_keyoff_right_count = 0
en_keyoff_a_count = 0
en_keyoff_b_count = 0
en_keyoff_c_count = 0
en_keyoff_d_count = 0
en_keyoff_ab_count = 0
en_keyoff_bc_count = 0
en_keyoff_uleft_count = 0
en_keyoff_uright_count = 0
en_keyoff_dleft_count = 0
en_keyoff_dright_count = 0
en_keyoff_neutral_count = 0

en_keystat_up = 0
en_keystat_down = 0
en_keystat_left = 0
en_keystat_right = 0
en_keystat_a = 0
en_keystat_b = 0
en_keystat_c = 0
en_keystat_d = 0
en_keystat_ab = 0
en_keystat_bc = 0
en_keystat_uleft = 0
en_keystat_uright = 0
en_keystat_dleft = 0
en_keystat_dright = 0
en_keystat_neutral = 0

pre_en_keystat_up = 0
pre_en_keystat_down = 0
pre_en_keystat_left = 0
pre_en_keystat_right = 0
pre_en_keystat_a = 0
pre_en_keystat_b = 0
pre_en_keystat_c = 0
pre_en_keystat_d = 0
pre_en_keystat_ab = 0
pre_en_keystat_bc = 0
pre_en_keystat_uleft = 0
pre_en_keystat_uright = 0
pre_en_keystat_dleft = 0
pre_en_keystat_dright = 0
pre_en_keystat_neutral = 0

en_flag_cmd236_2 = 0
en_flag_cmd236_23 = 0
en_flag_cmd236_236 = 0
en_flag_cmd236_236b = 0
en_flag_cmd236_236c = 0

en_flag_cmd214_2 = 0
en_flag_cmd214_21 = 0
en_flag_cmd214_214 = 0
en_flag_cmd214_214b = 0
en_flag_cmd214_214c = 0

en_flag_cmd623_6 = 0
en_flag_cmd623_62 = 0
en_flag_cmd623_623 = 0
en_flag_cmd623_623b = 0
en_flag_cmd623_623c = 0

en_flag_cmd421_4 = 0
en_flag_cmd421_42 = 0
en_flag_cmd421_421 = 0
en_flag_cmd421_421b = 0
en_flag_cmd421_421c = 0

en_flag_cmd252_2 = 0
en_flag_cmd252_25 = 0
en_flag_cmd252_252 = 0
en_flag_cmd252_252b = 0
en_flag_cmd252_252c = 0

en_flag_cmd656_6 = 0
en_flag_cmd656_65 = 0
en_flag_cmd656_656 = 0

en_flag_cmd454_4 = 0
en_flag_cmd454_45 = 0
en_flag_cmd454_454 = 0

en_flag_cmd28_2 = 0
en_flag_cmd28_28 = 0

en_flag_cmd29_2 = 0
en_flag_cmd29_29 = 0

en_flag_cmd27_2 = 0
en_flag_cmd27_27 = 0

en_flag_cmd454_4 = 0
en_flag_cmd454_45 = 0
en_flag_cmd454_454 = 0

en_flag_cmdd5d_d = 0
en_flag_cmdd5d_d5 = 0
en_flag_cmdd5d_d5d = 0

function key_count()
while true do

--get_key_map2(TAG_ENEMY)の一挙取得を１０の変数に分ける。
	en_keymap2_up,en_keymap2_down,en_keymap2_left,en_keymap2_right,en_keymap2_a,en_keymap2_b,en_keymap2_c,en_keymap2_d,en_keymap2_ab,en_keymap2_bc	=	get_key_map2(1)
--斜め入力はないため、別途に作成
--扱いの都合上、上下左右斜めﾆｭｰﾄﾗﾙABCDを作成することとした。
	--8
	if en_keymap2_up>=1 and en_keymap2_left==0 and en_keymap2_right==0 then
		en_keystat_up = 1
	else
		en_keystat_up = 0
	end
	--2
	if en_keymap2_down>=1 and en_keymap2_left==0 and en_keymap2_right==0 then
		en_keystat_down = 1
	else
		en_keystat_down = 0
	end
	--4
	if en_keymap2_left>=1 and en_keymap2_up==0 and en_keymap2_down==0 then
		en_keystat_left = 1
	else
		en_keystat_left = 0
	end
	--6
	if en_keymap2_right>=1 and en_keymap2_up==0 and en_keymap2_down==0 then
		en_keystat_right = 1
	else
		en_keystat_right = 0
	end
	--7
	if en_keymap2_up>=1 and en_keymap2_left>=1 then
		en_keystat_uleft = 1
	else
		en_keystat_uleft = 0
	end
	--9
	if en_keymap2_up>=1 and en_keymap2_right>=1 then
		en_keystat_uright = 1
	else
		en_keystat_uright = 0
	end
	--1
	if en_keymap2_down>=1 and en_keymap2_left>=1 then
		en_keystat_dleft = 1
	else
		en_keystat_dleft = 0
	end
	--3
	if en_keymap2_down>=1 and en_keymap2_right>=1 then
		en_keystat_dright = 1
	else
		en_keystat_dright = 0
	end
	--5
	if en_keymap2_up==0 and en_keymap2_down==0 and en_keymap2_left==0 and en_keymap2_right==0 then
		en_keystat_neutral = 1
	else
		en_keystat_neutral = 0
	end
	--a
	if en_keymap2_a>=1 then
		en_keystat_a = 1
	else
		en_keystat_a = 0
	end
	--b
	if en_keymap2_b>=1 then
		en_keystat_b = 1
	else
		en_keystat_b = 0
	end
	--c
	if en_keymap2_c>=1 then
		en_keystat_c = 1
	else
		en_keystat_c = 0
	end
	--d
	if en_keymap2_d>=1 then
		en_keystat_d = 1
	else
		en_keystat_d = 0
	end
	--ab
	if en_keymap2_ab>=1 then
		en_keystat_ab = 1
	else
		en_keystat_ab = 0
	end
	--bc
	if en_keymap2_bc>=1 then
		en_keystat_bc = 1
	else
		en_keystat_bc = 0
	end

--0->1時に初期化。それ以外ではカウント。キーOnカウント変数。
if en_keystat_up==1 and pre_en_keystat_up==0 then
	en_keyon_up_count = 1
else
	en_keyon_up_count = en_keyon_up_count+1
end
if en_keystat_down==1 and pre_en_keystat_down==0 then
	en_keyon_down_count = 1
else
	en_keyon_down_count = en_keyon_down_count+1
end
if en_keystat_left==1 and pre_en_keystat_left==0 then
	en_keyon_left_count = 1
else
	en_keyon_left_count = en_keyon_left_count+1
end
if en_keystat_right==1 and pre_en_keystat_right==0 then
	en_keyon_right_count = 1
else
	en_keyon_right_count = en_keyon_right_count+1
end
if en_keystat_uleft==1 and pre_en_keystat_uleft==0 then
	en_keyon_uleft_count = 1
else
	en_keyon_uleft_count = en_keyon_uleft_count+1
end
if en_keystat_uright==1 and pre_en_keystat_uright==0 then
	en_keyon_uright_count = 1
else
	en_keyon_uright_count = en_keyon_uright_count+1
end
if en_keystat_dleft==1 and pre_en_keystat_dleft==0 then
	en_keyon_dleft_count = 1
else
	en_keyon_dleft_count = en_keyon_dleft_count+1
end
if en_keystat_dright==1 and pre_en_keystat_dright==0 then
	en_keyon_dright_count = 1
else
	en_keyon_dright_count = en_keyon_dright_count+1
end
if en_keystat_neutral==1 and pre_en_keystat_neutral==0 then
	en_keyon_neutral_count = 1
else
	en_keyon_neutral_count = en_keyon_neutral_count+1
end
if en_keystat_a==1 and pre_en_keystat_a==0 then
	en_keyon_a_count = 1
else
	en_keyon_a_count = en_keyon_a_count+1
end
if en_keystat_b==1 and pre_en_keystat_b==0 then
	en_keyon_b_count = 1
else
	en_keyon_b_count = en_keyon_b_count+1
end
if en_keystat_c==1 and pre_en_keystat_c==0 then
	en_keyon_c_count = 1
else
	en_keyon_c_count = en_keyon_c_count+1
end
if en_keystat_d==1 and pre_en_keystat_d==0 then
	en_keyon_d_count = 1
else
	en_keyon_d_count = en_keyon_d_count+1
end
if en_keystat_ab==1 and pre_en_keystat_ab==0 then
	en_keyon_ab_count = 1
else
	en_keyon_ab_count = en_keyon_ab_count+1
end
if en_keystat_bc==1 and pre_en_keystat_bc==0 then
	en_keyon_bc_count = 1
else
	en_keyon_bc_count = en_keyon_bc_count+1
end

--1->0 時に初期化。それ以外ではカウント。キーOffカウント変数。
if en_keystat_up==0 and pre_en_keystat_up>=1 then
	en_keyoff_up_count = 1
else
	en_keyoff_up_count = en_keyoff_up_count+1
end
if en_keystat_down==0 and pre_en_keystat_down>=1 then
	en_keyoff_down_count = 1
else
	en_keyoff_down_count = en_keyoff_down_count+1
end
if en_keystat_left==0 and pre_en_keystat_left>=1 then
	en_keyoff_left_count = 1
else
	en_keyoff_left_count = en_keyoff_left_count+1
end
if en_keystat_right==0 and pre_en_keystat_right>=1 then
	en_keyoff_right_count = 1
else
	en_keyoff_right_count = en_keyoff_right_count+1
end
if en_keystat_uleft==0 and pre_en_keystat_uleft>=1 then
	en_keyoff_uleft_count = 1
else
	en_keyoff_uleft_count = en_keyoff_uleft_count+1
end
if en_keystat_uright==0 and pre_en_keystat_uright>=1 then
	en_keyoff_uright_count = 1
else
	en_keyoff_uright_count = en_keyoff_uright_count+1
end
if en_keystat_dleft==0 and pre_en_keystat_dleft>=1 then
	en_keyoff_dleft_count = 1
else
	en_keyoff_dleft_count = en_keyoff_dleft_count+1
end
if en_keystat_dright==0 and pre_en_keystat_dright>=1 then
	en_keyoff_dright_count = 1
else
	en_keyoff_dright_count = en_keyoff_dright_count+1
end
if en_keystat_neutral==0 and pre_en_keystat_neutral>=1 then
	en_keyoff_neutral_count = 1
else
	en_keyoff_neutral_count = en_keyoff_neutral_count+1
end
if en_keystat_a==0 and pre_en_keystat_a>=1 then
	en_keyoff_a_count = 1
else
	en_keyoff_a_count = en_keyoff_a_count+1
end
if en_keystat_b==0 and pre_en_keystat_b>=1 then
	en_keyoff_b_count = 1
else
	en_keyoff_b_count = en_keyoff_b_count+1
end
if en_keystat_c==0 and pre_en_keystat_c>=1 then
	en_keyoff_c_count = 1
else
	en_keyoff_c_count = en_keyoff_c_count+1
end
if en_keystat_d==0 and pre_en_keystat_d>=1 then
	en_keyoff_d_count = 1
else
	en_keyoff_d_count = en_keyoff_d_count+1
end
if en_keystat_ab==0 and pre_en_keystat_ab>=1 then
	en_keyoff_ab_count = 1
else
	en_keyoff_ab_count = en_keyoff_ab_count+1
end
if en_keystat_bc==0 and pre_en_keystat_bc>=1 then
	en_keyoff_bc_count = 1
else
	en_keyoff_bc_count = en_keyoff_bc_count+1
end



--▼236コマンド用フラグ▼
--●en_flag_cmd236_236b
if en_flag_cmd236_236>0 and en_keyon_b_count==1 then
	en_flag_cmd236_236b = en_flag_cmd236_236
end
if en_flag_cmd236_236b == en_flag_cmd236_236 then
	en_flag_cmd236_236 = 0
end
if en_flag_cmd236_236b>0 then
	en_flag_cmd236_236b = en_flag_cmd236_236b-1
end
--●en_flag_cmd236_236c
if en_flag_cmd236_236>0 and en_keyon_c_count==1 then
	en_flag_cmd236_236c = en_flag_cmd236_236
end
if en_flag_cmd236_236c == en_flag_cmd236_236 then
	en_flag_cmd236_236 = 0
end
if en_flag_cmd236_236c>0 then
	en_flag_cmd236_236c = en_flag_cmd236_236c-1
end
--●en_flag_cmd236_236
if en_flag_cmd236_23>0 and en_keyon_right_count==1 then
	en_flag_cmd236_236 = en_flag_cmd236_23
end
if en_flag_cmd236_236 == en_flag_cmd236_23 then
	en_flag_cmd236_23 = 0
end
if en_flag_cmd236_236>0 then
	en_flag_cmd236_236 = en_flag_cmd236_236-1
end
--●en_flag_cmd236_23
if en_flag_cmd236_2>0 and en_keyon_dright_count==1 then
	en_flag_cmd236_23 = en_flag_cmd236_2
end
if en_flag_cmd236_23 == en_flag_cmd236_2 then
	en_flag_cmd236_2 = 0
end
if en_flag_cmd236_23>0 then
	en_flag_cmd236_23 = en_flag_cmd236_23-1
end
--●en_flag_cmd236_2
if en_keyoff_down_count>0 then
	en_flag_cmd236_2 = en_flag_cmd236_2-1
end
if en_keyon_down_count<en_keyoff_down_count then
	en_flag_cmd236_2 = 14
end
--▲▲

--▼214コマンド用フラグ▼
--●en_flag_cmd214_214b
if en_flag_cmd214_214>0 and en_keyon_b_count==1 then
	en_flag_cmd214_214b = en_flag_cmd214_214
end
if en_flag_cmd214_214b == en_flag_cmd214_214 then
	en_flag_cmd214_214 = 0
end
if en_flag_cmd214_214b>0 then
	en_flag_cmd214_214b = en_flag_cmd214_214b-1
end
--●en_flag_cmd214_214c
if en_flag_cmd214_214>0 and en_keyon_c_count==1 then
	en_flag_cmd214_214c = en_flag_cmd214_214
end
if en_flag_cmd214_214c == en_flag_cmd214_214 then
	en_flag_cmd214_214 = 0
end
if en_flag_cmd214_214c>0 then
	en_flag_cmd214_214c = en_flag_cmd214_214c-1
end
--●en_flag_cmd214_214
if en_flag_cmd214_21>0 and en_keyon_left_count==1 then
	en_flag_cmd214_214 = en_flag_cmd214_21
end
if en_flag_cmd214_214 == en_flag_cmd214_21 then
	en_flag_cmd214_21 = 0
end
if en_flag_cmd214_214>0 then
	en_flag_cmd214_214 = en_flag_cmd214_214-1
end
--●en_flag_cmd214_21
if en_flag_cmd214_2>0 and en_keyon_dleft_count==1 then
	en_flag_cmd214_21 = en_flag_cmd214_2
end
if en_flag_cmd214_21 == en_flag_cmd214_2 then
	en_flag_cmd214_2 = 0
end
if en_flag_cmd214_21>0 then
	en_flag_cmd214_21 = en_flag_cmd214_21-1
end
--●en_flag_cmd214_2
if en_keyoff_down_count>0 then
	en_flag_cmd214_2 = en_flag_cmd214_2-1
end
if en_keyon_down_count<en_keyoff_down_count then
	en_flag_cmd214_2 = 14
end
--▲▲

--▼623コマンド用フラグ▼
--●en_flag_cmd623_623b
if en_flag_cmd623_623>0 and en_keyon_b_count==1 then
	en_flag_cmd623_623b = en_flag_cmd623_623
end
if en_flag_cmd623_623b == en_flag_cmd623_623 then
	en_flag_cmd623_623 = 0
end
if en_flag_cmd623_623b>0 then
	en_flag_cmd623_623b = en_flag_cmd623_623b-1
end
--●en_flag_cmd623_623c
if en_flag_cmd623_623>0 and en_keyon_c_count==1 then
	en_flag_cmd623_623c = en_flag_cmd623_623
end
if en_flag_cmd623_623c == en_flag_cmd623_623 then
	en_flag_cmd623_623 = 0
end
if en_flag_cmd623_623c>0 then
	en_flag_cmd623_623c = en_flag_cmd623_623c-1
end
--●en_flag_cmd623_623
if en_flag_cmd623_62>0 and en_keyon_dright_count==1 then
	en_flag_cmd623_623 = en_flag_cmd623_62
end
if en_flag_cmd623_623 == en_flag_cmd623_62 then
	en_flag_cmd623_62 = 0
end
if en_flag_cmd623_623>0 then
	en_flag_cmd623_623 = en_flag_cmd623_623-1
end
--●en_flag_cmd623_62
if en_flag_cmd623_6>0 and en_keyon_down_count==1 then
	en_flag_cmd623_62 = en_flag_cmd623_6
end
if en_flag_cmd623_62 == en_flag_cmd623_6 then
	en_flag_cmd623_6 = 0
end
if en_flag_cmd623_62>0 then
	en_flag_cmd623_62 = en_flag_cmd623_62-1
end
--●en_flag_cmd623_6
if en_keyoff_right_count>0 then
	en_flag_cmd623_6 = en_flag_cmd623_6-1
end
if en_keyon_right_count<en_keyoff_right_count then
	en_flag_cmd623_6 = 14
end
--▲▲

--▼421コマンド用フラグ▼
--●en_flag_cmd421_421b
if en_flag_cmd421_421>0 and en_keyon_b_count==1 then
	en_flag_cmd421_421b = en_flag_cmd421_421
end
if en_flag_cmd421_421b == en_flag_cmd421_421 then
	en_flag_cmd421_421 = 0
end
if en_flag_cmd421_421b>0 then
	en_flag_cmd421_421b = en_flag_cmd421_421b-1
end
--●en_flag_cmd421_421c
if en_flag_cmd421_421>0 and en_keyon_c_count==1 then
	en_flag_cmd421_421c = en_flag_cmd421_421
end
if en_flag_cmd421_421c == en_flag_cmd421_421 then
	en_flag_cmd421_421 = 0
end
if en_flag_cmd421_421c>0 then
	en_flag_cmd421_421c = en_flag_cmd421_421c-1
end
--●en_flag_cmd421_421
if en_flag_cmd421_42>0 and en_keyon_dleft_count==1 then
	en_flag_cmd421_421 = en_flag_cmd421_42
end
if en_flag_cmd421_421 == en_flag_cmd421_42 then
	en_flag_cmd421_42 = 0
end
if en_flag_cmd421_421>0 then
	en_flag_cmd421_421 = en_flag_cmd421_421-1
end
--●en_flag_cmd421_42
if en_flag_cmd421_4>0 and en_keyon_down_count==1 then
	en_flag_cmd421_42 = en_flag_cmd421_4
end
if en_flag_cmd421_42 == en_flag_cmd421_4 then
	en_flag_cmd421_4 = 0
end
if en_flag_cmd421_42>0 then
	en_flag_cmd421_42 = en_flag_cmd421_42-1
end
--●en_flag_cmd421_4
if en_keyoff_left_count>0 then
	en_flag_cmd421_4 = en_flag_cmd421_4-1
end
if en_keyon_left_count<en_keyoff_left_count then
	en_flag_cmd421_4 = 14
end
--▲▲

--▼252コマンド用フラグ▼
--●en_flag_cmd252_252b
if en_flag_cmd252_252>0 and en_keyon_b_count==1 then
	en_flag_cmd252_252b = en_flag_cmd252_252
end
if en_flag_cmd252_252b == en_flag_cmd252_252 then
	en_flag_cmd252_252 = 0
end
if en_flag_cmd252_252b>0 then
	en_flag_cmd252_252b = en_flag_cmd252_252b-1
end
--●en_flag_cmd252_252c
if en_flag_cmd252_252>0 and en_keyon_c_count==1 then
	en_flag_cmd252_252c = en_flag_cmd252_252
end
if en_flag_cmd252_252c == en_flag_cmd252_252 then
	en_flag_cmd252_252 = 0
end
if en_flag_cmd252_252c>0 then
	en_flag_cmd252_252c = en_flag_cmd252_252c-1
end
--●en_flag_cmd252_252
if en_flag_cmd252_25>0 and en_keyon_down_count==1 then
	en_flag_cmd252_252 = en_flag_cmd252_25
end
if en_flag_cmd252_252 == en_flag_cmd252_25 then
	en_flag_cmd252_25 = 0
end
if en_flag_cmd252_252>0 then
	en_flag_cmd252_252 = en_flag_cmd252_252-1
end
--●en_flag_cmd252_25
if en_flag_cmd252_2>0 and en_keyon_neutral_count==1 then
	en_flag_cmd252_25 = en_flag_cmd252_2
end
if en_flag_cmd252_25 == en_flag_cmd252_2 then
	en_flag_cmd252_2 = 0
end
if en_flag_cmd252_25>0 then
	en_flag_cmd252_25 = en_flag_cmd252_25-1
end
--●en_flag_cmd252_2
if en_keyoff_down_count>0 then
	en_flag_cmd252_2 = en_flag_cmd252_2-1
end
if en_keyon_down_count<en_keyoff_down_count then
	en_flag_cmd252_2 = 14
end
--▲▲

--▼656コマンド用フラグ▼
--●en_flag_cmd656_656
if en_flag_cmd656_65>0 and en_keyon_right_count==1 then
	en_flag_cmd656_656 = en_flag_cmd656_65
end
if en_flag_cmd656_656 == en_flag_cmd656_65 then
	en_flag_cmd656_65 = 0
end
if en_flag_cmd656_656>0 then
	en_flag_cmd656_656 = en_flag_cmd656_656-1
end
--●en_flag_cmd656_65
if en_flag_cmd656_6>0 and en_keyon_neutral_count==1 then
	en_flag_cmd656_65 = en_flag_cmd656_6
end
if en_flag_cmd656_65 == en_flag_cmd656_6 then
	en_flag_cmd656_6 = 0
end
if en_flag_cmd656_65>0 then
	en_flag_cmd656_65 = en_flag_cmd656_65-1
end
--●en_flag_cmd656_6
if en_keyoff_right_count>0 then
	en_flag_cmd656_6 = en_flag_cmd656_6-1
end
if en_keyon_right_count<en_keyoff_right_count and en_keyon_right_count==1 then
	en_flag_cmd656_6 = 14
end
--▲▲

--▼454コマンド用フラグ▼
--●en_flag_cmd454_454
if en_flag_cmd454_45>0 and en_keyon_left_count==1 then
	en_flag_cmd454_454 = en_flag_cmd454_45
end
if en_flag_cmd454_454 == en_flag_cmd454_45 then
	en_flag_cmd454_45 = 0
end
if en_flag_cmd454_454>0 then
	en_flag_cmd454_454 = en_flag_cmd454_454-1
end
--●en_flag_cmd454_45
if en_flag_cmd454_4>0 and en_keyon_neutral_count==1 then
	en_flag_cmd454_45 = en_flag_cmd454_4
end
if en_flag_cmd454_45 == en_flag_cmd454_4 then
	en_flag_cmd454_4 = 0
end
if en_flag_cmd454_45>0 then
	en_flag_cmd454_45 = en_flag_cmd454_45-1
end
--●en_flag_cmd454_4
if en_keyoff_left_count>0 then
	en_flag_cmd454_4 = en_flag_cmd454_4-1
end
if en_keyon_left_count<en_keyoff_left_count and en_keyon_left_count==1 then
	en_flag_cmd454_4 = 14
end
--▲▲



--print(en_flag_cmd656_6,en_flag_cmd656_65,en_flag_cmd656_656,enemy_act,en_keyon_b_count,"  ",en_keystat_b,pre_en_keystat_b," ",get_key_map2(1)
--,en_keyon_neutral_count,en_keyoff_neutral_count,en_keystat_up,pre_en_keystat_up,en_keyon_up_count,en_keyoff_up_count
--);
	
pre_en_keystat_up = en_keystat_up
pre_en_keystat_down = en_keystat_down
pre_en_keystat_left = en_keystat_left
pre_en_keystat_right = en_keystat_right
pre_en_keystat_uleft = en_keystat_uleft
pre_en_keystat_uright = en_keystat_uright
pre_en_keystat_dleft = en_keystat_dleft
pre_en_keystat_dright = en_keystat_dright
pre_en_keystat_neutral = en_keystat_neutral
pre_en_keystat_a = en_keystat_a
pre_en_keystat_b = en_keystat_b
pre_en_keystat_c = en_keystat_c
pre_en_keystat_d = en_keystat_d
pre_en_keystat_ab = en_keystat_ab
pre_en_keystat_bc = en_keystat_bc

	yield();
end
end