O'Reilly logo

Programming Wireless Devices with the Java™ 2 Platform, Micro Edition, Second Edition by Jim Holliday - Editor, Aleksi Uotila, Mark Patel, Jyri Huopaniemi, Jim Van Peursem, Antero Taivalsaari, Roger Riggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11.2. Low-Level API for Events in Canvases

11.2.1. Key Events

If the application needs to handle key events in its Canvas, it must override the Canvas methods keyPressed, keyReleased, and keyRepeated. When a key is pressed, the keyPressed method is called with the key code. If the key is held down long enough to repeat, the keyRepeated method is called for each repeated keyCode. When the key is released, the keyReleased method is called. Some devices might not support repeating keys, and if not, the keyRepeated method is never called. The application can check the availability of repeat actions by calling the method Canvas.hasRepeatEvents.

MIDP target devices are required to support the ITU-T telephone keys. Key codes are defined in the Canvas ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required