From Java Runtime 2.2 for Symbian onwards, Symbian touch devices
support multipoint touch events on Canvas
and GameCanvas
. To enable multipoint touch events, set the Nokia-UI-Enhancement
JAD attribute to EnableMultiPointTouchEvents
.
The number of supported touch points depends on the limitations set by the device.
Figure: Multipoint touch with two touch points
The screenshots are part of a small multipoint touch example.
When multipoint touch events are enabled, you can query the com.nokia.pointer.number
system property in Canvas
and GameCanvas
methods pointerPressed
, pointerDragged
, or pointerReleased
to obtain the pointer number of the pointer that was source of the
event.
The code snippet demonstrates how to obtain the pointer number
with the pointerPressed
method:
protected void pointerPressed(int x, int y) { String idString = System.getProperty("com.nokia.pointer.number"); int pointerId = 0; if (idString != null) { pointerId = Integer.parseInt(idString); } ... }
The system property com.nokia.pointer.number
exists only in the scope of methods pointerPressed
, pointerDragged
or pointerReleased
and outside of these methods returned value will be null
.
Enabling multipoint touch events with JAD attribute Nokia-UI-Enhancement
does not enable multipoint touch events in any other part of the
LCDUI framework.
It is possible to enable multipoint touch support in the Symbian^3 SDK for Nokia devices. For more information, see Support for Multiple Pointers in the Emulator in the Nokia Symbian^3 Developer's Library.