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: navigationkeysThree 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
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.Nokia-MIDlet-On-Screen-Softkeys-Position: bottom Nokia-MIDlet-On-Screen-Softkeys-Position: right // default, this is used, if no property exists in the jad fileThe 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.
Original link: http://wiki.forum.nokia.com/index.php/Using_on-screen_keypad_in_MIDlets_in_S60_5th_Edition_devices