07-23-2009 12:43 PM - edited 07-23-2009 12:45 PM
Been playing with the Storm Emulator and the 4.7 JDE, for the life of me I can't figure out how to fire gesture events in the emulator.
Below is the touch event code for the RIM sample app EmbeddedMapDemo. It seems straightforward enough, but touchGesture.getEvent() == TouchGesture.SWIPE never seems to register to true.
How can I register swipes in the Emulator? With my mouse I try doing left-click and drag but that does not seem to work.
* @see Field#touchEvent(TouchEvent)
protected boolean touchEvent(TouchEvent message)
boolean isConsumed = false;
TouchGesture touchGesture = message.getGesture();
if (touchGesture != null)
// If the user has performed a swipe gesture we will move the
// map accordingly.
if (touchGesture.getEvent() == TouchGesture.SWIPE)
// Retrieve the swipe magnitude so we know how
// far to move the map.
int magnitude = touchGesture.getSwipeMagnitude();
// Move the map in the direction of the swipe.
_mapField.move(0, - magnitude);
_mapField.move(- magnitude, 0);
isConsumed = true; // We've consumed the touch event.
07-23-2009 04:16 PM
The swipe is extremely difficult to simulate with a mouse, but it *does* work.
You have to swipe the mouse very quickly.
You can also change the sensitivity settings in the simulator device options.