×
Namespaces

Variants
Actions

Using on-screen keypad in MIDlets in S60 5th Edition devices

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Compatibility
Platform(s):
S60 5th Edition
Article
Created: jarmlaht (29 Oct 2008)
Last edited: hamishwillee (09 Aug 2013)

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

Tube minesweeper3.png

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

Tube minesweeper4.png

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 file

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.

N97 open.pngN97 open bottom.png

See also

This page was last modified on 9 August 2013, at 07:38.
145 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×