Canvas

If Canvas is in the full screen mode and it has no CommandListener, the MIDlet triggers low-level key events from the softkeys and is thus in full control of them. If there are one or more Commands, pressing any softkey shows the Options menu even though there is no control pane visible and thus there are no softkey labels visible.

Since there is no universal indicator pane to show the network activity indicator, the full screen mode Canvas renders a connection indicator on top of the main pane. Indicator differs depending on the network bearer.

From S60 5th Edition onwards, in the full screen mode, the network indicator is not shown for manufacturer domain applications, and in the operator domain it can be suppressed with a Central Repository setting.

A full screen mode Canvas is changed to a normal mode Canvas when an Alert is called and displayed on top of the Canvas. After Alert is dismissed Canvas is changed back to full screen mode.

Table: Softkey behavior in different situations with full screen mode Canvas

Situation

Behavior of a key press to softkeys or Selection key

There are Commands and a CommandListener defined

The Options menu is presented.

Note: The Commands are not directly associated with the softkeys but shown in the Options menu.

There is no CommandListener set for Canvas in full screen mode.

Selection key (and other softkeys) triggers low-level key events to the MIDlet.

There is a CommandListener but no Commands set for Canvas in full screen mode.

Selection key (and other softkeys) triggers low-level key events to the MIDlet.

Note: Canvas in normal mode does not get the low-level key events even if there is no CommandListener.

Buffering

Canvas in S60 is always double buffered, which means that each Canvas instance creates a new backbuffer. Therefore using multiple Canvas instances results in high memory consumption.

From S60 3rd Edition FP 2 onwards, Canvas instances share a common backbuffer. Therefore creating many Canvas instances consumes considerably less memory.

Note: GameCanvas instances operate with a dedicated backbuffer, so the above memory performance improvement applies only for Canvas.

Key events

The following physical keys can be mapped to MIDP-defined logical key events. Keys marked with * are only visible on FullCanvas and in Canvas in full screen mode when there are no CommandListener or Commands set.

Table: Additional physical keys

Physical Key

Key code decimal value

Scroll up

-1

Scroll down

-2

Scroll left

-3

Scroll right

-4

Clear key

-8

Edit key

-50

End key

-11

Send key

-10

Applications key

-12

Voice key

-13

Play/pause key

-20

Previous

-21

Next

-22

Stop

-23

Selection key

-5

Softkey1 (left softkey

-6

Softkey2 (right softkey)

-7

Note: The End key event is used by the system to exit the MIDlet and to go to the device’s Idle state (or to terminate active calls). A MIDlet can however explicitly define if it is closed or continues to run in the background.

Note: Some keys defined in above table may not be available with a full keyboard. For example, the Clear key is not available, because the full keyboard contains the backspace key whose Unicode value is 8. Note also that pressing the Shift key alone in a full keyboard causes a key event with the key code 50 (an Edit key event). If the Shift key is pressed together with another key, it causes only the combined key event, not the Edit key event with the key code 50.

A full keyboard contains also other standard physical keys, including letters and characters such as @ and +. Their key codes are equal to the Unicode value for the corresponding character. For example, the letter key A has the key code 97 and its key name string is a. A full keyboard provides also combined keys, for example Shift+A has the key code 65 and its key name string is A.

Table: Additional physical keys available only in full keyboard (QWERTY)

Physical key

Key code

Space

32

Backspace

8

Escape

27

Tab

9

Enter

10

Delete

127

Softkey behavior

When the Canvas is in full screen mode and it has a CommandListener and one or more Commands, then pressing of any softkey opens the options menu. The options menu contains all Commands that are added to the Canvas.

When the Canvas is in full screen mode but CommandListener has not been set to it or CommandListener has been set but there are no Commands added to the Canvas, then pressing of a softkey posts a key event to Java Canvas.

Note: LCDUI Canvas graphics scaling with MMAPI VideoControl is not implemented. When playing video, MMAPI uses DSA. The Canvas graphics scaling works by scaling the content of the LCDUI Canvas framebuffer. But the MMAPI Video content (via DSA) is not present on the framebuffer, and therefore the video is not scaled. Thus, we don't recommend using Canvas scaling feature together with video content via MMAPI. Other MMAPI functionality can be used properly (audio etc.).

Note: For backward compatibility to S60 releases prior to 3.2, it is possible to enable low-level key event triggering from Selection key both in normal mode Canvas and in full screen Canvas with Commands and CommandListener defined. If this feature is enabled, no Commands will be mapped to Selection key. Instead the relevant low-level key event will be triggered. Note that in a full screen mode Canvas without any Commands and CommandListener defined this feature does not have any effect as low level key events are triggered from all softkeys in any case.

To enable this feature the following attribute should be added to the JAD or manifest file of the Java application with value true: Nokia-MIDlet-S60-Selection-Key-Compatibility. For more information, see section JAD and JAR manifest attributes.