public int getGameAction(int key)
{
if(key == -1||key == KEY_NUM2)
return UP;
else if(key == -3||key == KEY_NUM4)
return LEFT;
else if(key == -5||key == KEY_NUM5)
return FIRE;
else if(key == -4||key == KEY_NUM6)
return RIGHT;
else if(key == -2||key == KEY_NUM8)
return DOWN;
else
return 0;
}
把这段代码放在游戏代码中,即可解决K700左右软键无响应bug.