Simulating touch messages on desktop - what do the smart kids do?

Ken Ray kray at sonsothunder.com
Tue Feb 14 02:27:41 EST 2012


> I used to do it your way -- passing touch messages to mouse messages after checking the environment. When we were writing the teaching stack for the conference, Mark Waddingham suggested we just ditch the touch messages entirely and use only mouse messages. I've been doing that ever since, it works fine. Touch messages are passed to mouse messages automatically, so eliminating them also removes an extra message from the hierarchy and avoids the problem of double messages entirely.

There's also the difference in how often certain messages are sent. MouseMove, for example, is sent much more frequently than touchMove. For example if you do a single tap on a locked field in iOS, you get:

mouseMove
mouseDown
touchStart
touchMove
mouseMove
mouseUp
mouseMove
touchEnd

It's not quite as bad on Android but you still get more mouseMove messages than touchMove:

mouseMove
mouseDown
touchStart
touchMove
mouseUp
mouseMove
touchEnd

And that's just with a simple tap… when I was tracking tap-and-drag, I got about 3x as many mouseMove messages as touchMove. 

Just FYI,

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/	




More information about the use-livecode mailing list