Search code examples
java-memidplcduijava-wireless-toolkit

how to disable navigation keys in j2me?


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?


Solution

  • public void keyPressed(int keyCode) {
            int action = getGameAction(keyCode);
            if (action == UP || action == DOWN || action == LEFT || action == RIGHT)
            {}
            else
                super.keyPressed(keyCode);
    }