Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
gerardkcohen
Posts: 48
Registered: ‎10-06-2009

Gesture events on Simulator

Can anyone tell me how to test gesture events in the PB simulator? I have not been able to find any information on this. Thank you in advance. gkc
Please use plain text.
Developer
peter9477
Posts: 6,448
Registered: ‎12-08-2010
My Carrier: none

Re: Gesture events on Simulator

You cannot, yet.

 

That said, I haven't heard of anyone trying to simulate them by injecting those events into the app in some fashion.  In other environments I'd do this in a snap, but I don't quite know whether it's feasible in AS3.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
jtegen
Posts: 6,537
Registered: ‎10-27-2010
My Carrier: Verizon

Re: Gesture events on Simulator

We cannot at this point.  Some can be captured by mouse events, but gestures like pinch cannot be done in the simulator at this point.

Please use plain text.
Developer
gerardkcohen
Posts: 48
Registered: ‎10-06-2009

Re: Gesture events on Simulator

Thank you both for the quick response.
Please use plain text.
Developer
peter9477
Posts: 6,448
Registered: ‎12-08-2010
My Carrier: none

Re: Gesture events on Simulator

I'm hoping nobody takes the response as completely negative though.  

 

I really am curious why, if it's not possible, one could not simply inject the appropriate events into the system.  Isn't it roughly just a case of creating a "new SomeGestureEvent()" with appropriate parameters, and dispatchEvent()ing that into the stage, main class, or some other object?

 

If this is basically feasible, one could even whip up a bridge program that would run on the host, letting you interact to set up gestures using the mouse (or real gestures, if you had a suitable monitor and OS), and then pass those through to the app under test in the simulator to "play" them as though they were native.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
jtegen
Posts: 6,537
Registered: ‎10-27-2010
My Carrier: Verizon

Re: Gesture events on Simulator

This is very feasible.  I do this for GPS events.  As long as you set the needed attributes, you can create a "driver" class that you can trigger by a button, click, etc.  And then just dispatch the event to the desired target that "normal" objects are listening to.

Please use plain text.
Developer
billfoust
Posts: 382
Registered: ‎05-19-2008
My Carrier: AT&T

Re: Gesture events on Simulator

The biggest problem with faking gesture events, at least in a generic fashion, would be location. GPS data doesn't have a screen X and Y but a pinch would.

 

I also thought that swipe events were implmented. its only the multi-touch gestures that are not implemented. Am I remembering correctly?

 

Bill

Bill
-------------------------------------------
Check out my book on BlackBerry Development for Java.
And my other really really old book
My Apps: FlashKids
Please use plain text.
Developer
jtegen
Posts: 6,537
Registered: ‎10-27-2010
My Carrier: Verizon

Re: Gesture events on Simulator

You could set a "mode" that when a click occurs, it then generates the appropriate gesture at that point.  If it is a pinch, maybe that is the center point and a pinch in or pinch out could be when a second click occurs.

 

It can be done, you just have to be a little creative.

Please use plain text.
Developer
peter9477
Posts: 6,448
Registered: ‎12-08-2010
My Carrier: none

Re: Gesture events on Simulator

Bill, I'm picturing a support program on the host which provides a simulated touch area, and you simply interact with it with your mouse.  As John suggested, you could have buttons and/or hotkeys that would let you select various modes.  The results including X/Y coords would be sent through to the simulator to be regenerated as the appropriate events.

 

Your memory is wrong about the swipe events though, I believe.  I'm under the impression no touch events of any kind are generated on the simulator right now, swipe or gesture (if those are the appropriate names for the two categories).


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
jffurlan
Posts: 1,003
Registered: ‎01-16-2011
My Carrier: Rogers

Re: Gesture events on Simulator

Hust wanted to clarify that a touch event swipe won't work, but a mouse event swipe will.
- If you like my response/post, or it helped you find an answer you were looking for, please provide a Kudo - white star to the bottom right of this post. -
- Please use the search bar at the top, or check out the PlayBook FAQ's for help getting started -
- Hockey DrillBook -
Please use plain text.