我们正在为我们的j2me应用程序使用Sun Java Wireless Toolkit 2.5.2和lcdui软件包。我们想以编程方式禁用导航键(UP,DOWN,LEFT,RIGHT)。我该怎么办?
答案 0 :(得分:5)
public void keyPressed(int keyCode) {
int action = getGameAction(keyCode);
if (action == UP || action == DOWN || action == LEFT || action == RIGHT)
{}
else
super.keyPressed(keyCode);
}