02-16-2011 10:56 AM
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.
02-16-2011 10:56 AM
02-16-2011 11:03 AM
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.
02-16-2011 11:08 AM
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.
02-16-2011 11:39 AM
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?
02-16-2011 11:56 AM
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.
02-16-2011 01:05 PM
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).
02-16-2011 02:33 PM