I work with a Blackberry Touch Event, and I need to process TouchEvent.MOVEit TouchEvent.UPboth TouchEvent.DOWNto move the carousel of images and TouchEvent.CLICKto create a specific action.
My problem is that the method touchEvent()is called multiple times. How can I prevent this? Because the behavior is all messed up.
For example: when I just want to capture an event TouchEvent.CLICK, UP-DOWN-MOVE-CLICK fires one after another.
My code does the following:
protected boolean touchEvent(TouchEvent message) {
if (message.getEvent() == TouchEvent.CLICK) {
return true;
} else if ((message.getEvent() == TouchEvent.MOVE)
|| (message.getEvent() == TouchEvent.UP)
|| (message.getEvent() == TouchEvent.DOWN)) {
} else {
return false;
}
}
public void moverTouch(int dx) {
}
, CLICK , , MOVE UP DOWN , Field , , .
, JUST CLICK, , moverTouch() , , .