We are using Sun Java Wireless Toolkit 2.5.2 and lcdui package for our j2me application. We want to disable the navigation keys (UP, DOWN, LEFT, RIGHT) programmatically. How can I do it?

有帮助吗?

解决方案

public void keyPressed(int keyCode) {
        int action = getGameAction(keyCode);
        if (action == UP || action == DOWN || action == LEFT || action == RIGHT)
        {}
        else
            super.keyPressed(keyCode);
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top