Blackberry Storm Emulator - TouchGesture events not firing, how to get a Swipe to work?
-
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; if(_mapField.isClicked()) { 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. switch(touchGesture.getSwipeDirection()) { case TouchGesture.SWIPE_NORTH: _mapField.move(0, - magnitude); break; case TouchGesture.SWIPE_SOUTH: _mapField.move(0, magnitude); break; case TouchGesture.SWIPE_EAST: _mapField.move(- magnitude, 0); break; case TouchGesture.SWIPE_WEST: _mapField.move(magnitude, 0); break; } // We've consumed the touch event. isConsumed = true; } } } return isConsumed; }
-
Answer:
Pressing the left mouse button simulates clicking down the screen... the simulator (and also an actual Storm device, I think) won't fire TouchGesture events while you're clicking down on the screen. What you want to do is hold down the right mouse button and drag, since the right mouse button simulates a screen tap, without click. This way, you should be able to get TouchGestures to fire. It's a little hard to do a gesture on the simulator, you kinda have to move fast, but if you use the right mouse button you should be able to do it.
AtariPete at Stack Overflow Visit the source
Related Q & A:
- How To Get Online Data Mining Work?Best solution by theatlantic.com
- How to get my LAUNCHcast plugin work?Best solution by Yahoo! Answers
- How to get a Work Permit?Best solution by dir.ca.gov
- How do i get a camera to work on msn?Best solution by Yahoo! Answers
- How to get a job with no work experience?Best solution by eHow old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.