Using on-screen keypad in MIDlets in S60 5th Edition devices
Article Metadata
Contents |
Overview
S60 5th Edition introduced touch screen and also larger screen of 640 x 360 pixels. For making it easier to run older MIDlets in these devices there is so called on-screen keypad available for MIDlets. It offers backwards compatibility for MIDlets, which are using Canvas and are not originally made for touch devices.
On-screen keypad takes part of the screen from Canvas and offers possibility to use keypad and generate key events for the Canvas application. Pointer events still work normally in the Canvas area despite of the on-screen keypad presence.
Usage
On-screen keypad launches automatically for every installed MIDlet, but user is able to change On-screen keypad visibility from the application manager setting. Possible values are "off", "Navigation keys only" and "Game and navigation keys". The setting is application specific and thus can be defined differently for every installed MIDlet suite. The state of on-screen keypad is defined by using a JAD parameter "Nokia-MIDlet-On-Screen-Keypad", its possible values are "no", "gameactions" and "navigationkeys".
Nokia-MIDlet-On-Screen-Keypad: no
Nokia-MIDlet-On-Screen-Keypad: gameactions
Nokia-MIDlet-On-Screen-Keypad: navigationkeys
Three possible on-screen keypad settings:
- No keypad
- Navigation keys keypad: game actions UP, DOWN, LEFT, RIGHT and FIRE
- Game actions keypad: game actions UP, DOWN, LEFT, RIGHT, FIRE, GAME_A, GAME_B GAME_C and GAME_D
A keypad also includes two softkey buttons. Note, that On-screen keypad has no number or letter keys, just the keys listed above. Note also, that if an application has defined the on-screen keypad setting user cannot change it. If the setting is not defined by using the JAD attribute, user can change it. The on-screen keypad setting is valid for entire MIDlet suite. By default if no keypad setting has been defined the game actions keypad is displayed.
The image below shows the three settings on portrait 360 x 640 screen: on-screen keypad with navigation and game keys, on-screen keypad with navigation keys and no on-screen keypad. The screen resolutions for the screens (actual Canvas drawing area) are:
- full screen without on-screen keypad: 360 x 640
- full screen with on-screen keypad with navigation keys: 360 x 384
- full screen with on-screen keypad with navigation and game keys: 360 x 360
- NOT full screen without on-screen keypad: 360 x 487
- NOT full screen with on-screen keypad with navigation keys: 360 x 292
- NOT full screen with on-screen keypad with navigation and game keys: 360 x 240
The image below shows the three settings on landscape 640 x 360 screen: on-screen keypad with navigation and game keys, on-screen keypad with navigation keys and no on-screen keypad. The screen resolutions for the screens (actual Canvas drawing area) are:
- full screen without on-screen keypad: 640 x 360
- on-screen keypad with navigation keys: 372 x 360
- on-screen keypad with navigation and game keys: 320 x 360
- NOT full screen without on-screen keypad: 502 x 288
- NOT full screen with on-screen keypad with navigation keys: 298 x 288
- NOT full screen with on-screen keypad with navigation and game keys: 251 x 288
The images above also show, how the "Nokia-MIDlet-Original-Display-Size" JAD attribute works in practice.
On-screen keypad in devices with keyboard
In devices with touch screen and additional keyboard (like Nokia N97) opening the keyboard adds a new mode of on-screen keypad. When the keyboard is opened, arrow and game keys are removed and soft key labels are shown on right edge or on bottom of the screen. The position can be chosen by using "Nokia-MIDlet-On-Screen-Softkeys-Position" system property. If no property is used, the soft keys are on the right side as default. Note, that if "Nokia-MIDlet-On-Screen-Keypad" attribute has "no" value, soft keys are not shown at all.
The Canvas screen size is 580x360 pixels, when the soft keys are on the right and 480x360 pixels, when the soft keys are on the bottom.






14 Sep
2009
This article is about on screen keypad through j2me.when you are making games first thing you need to do is to set commands for buttons. but this article explains about onscreen keypad. so that in touch phones which doesn't provide kaypad this article will help to make applicatoin that supports touch phone.
Series 60 touch phone of 5th edition has larger screen and provide on screen keyboard so this article is good for making application for that phones.
14 Sep
2009
Interesting read about onscreen keypad and its various settings. Good to know when developing for 5th edition. Aritcle is well written with nice pictures showing different types of keypad, which is good, because just explaining it in words not always explains everything. I think author explained every aspect of topic and done it in elegant way. Definetly thumbs up.
Boffill - Download
How can I download this so I can install this on my N8?Boffill 10:22, 20 November 2011 (EET)
Hamishwillee - @Boffill - Download what?
Hi Boffill
There is no app download associated with this article - all the screenshots are for demonstration purposes only.
Regards
Hamishhamishwillee 04:06, 21 November 2011 (EET)