|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES All Classes |
See:
Description
Interface Summary | |
---|---|
MultipointTouchListener | This interface is used by applications which need to receive multipoint touch events from the implementation. |
Class Summary | |
---|---|
MultipointTouch | MultipointTouch class provides access to data and configuration related to the multiple touch points. |
The Series 40 Touch UI phones support MultipointTouch events.
The system property com.nokia.mid.ui.multipointtouch.version can be used to determine version of the Nokia Multipoint Touch API.
A MIDlet can use the MultipointTouchListener
interface to receive multi-touch events from the platform. By
implementing the interface the MIDlet is informed about all pointers that have changed (pressed, moved or released).
The MultipointTouchListener
interface uses the Observer design pattern. To use this API MIDlets must implement
MultipointTouchListener. This defines a listener for the MultipointTouch event notifications. The pointersChanged
method receives an array of pointer Ids for all changed pointers.
The MultipointTouch class keeps track of all fingers in the touchpad. e.g. if middle and index finger were previously
pressed down and end user moves index finger then only the movement of the index finger is notified through
MultiTouchListener
. A MIDlet can use MultipointTouch class to get the state and x- and y-coordinates
of each pointer at any given time, not only in pointersChanged method.
public void pointersChanged( int[] pointerIds ){
int pointerId;
int x;
int y;
int state;
// Go through the array
for(int i=0; i < pointerIds.length; i++){
// Get pointerId.
pointerId = pointerIds[i];
// Read the pointer state.
state = MultipointTouch.getState(pointerId);
// Read the pointer X and Y coordinate.
x = MultipointTouch.getX(pointerId);
y = MultipointTouch.getY(pointerId);
switch(state){
case MultipointTouch.POINTER_PRESSED:
// A new finger was pressed.
break;
case MultipointTouch.POINTER_DRAGGED:
// An existing finger was moved.
break;
case MultipointTouch.POINTER_RELEASED:
// An existing finger was lifted.
break;
default:
break;
}
}
}
|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES All Classes |