[lively-kernel] iPad: mouse vs touch events
Dan Ingalls
danhhingalls at gmail.com
Tue Apr 20 23:22:05 CEST 2010
[re-sent to the list, not just sender]
Hello Werner -
I've just been trying to sort this out, and I've just checked in some useful code in the repository, but I don't have it all working just right. At least you will find
UserAgent.isiPhone // a boolean you can test
UserAgent.iPhoneDragMode(); // Makes LK receive mouse move events
UserAgent.iPhonePanMode(); // Leaves touch events going to OS for pan/zoom
In addition to the Apple link you cite, I found this to be useful...
http://rossboucher.com/2008/08/19/iphone-touch-events-in-javascript/
I think I'm pretty close. At least, when I get into drag mode, I can click on things and drag them, and when it's in pan mode, the OS does the right stuff. My first goal is just to get it working so that if you click in the world, it will go into pan mode, and if you click on anything else, it will go into drag mode. But apparently mouse focus (which I'm using) doesn't often get set when dragging things (I need to review this).
I don't have an SDK, so I'm using an iPhone to test. I've just checked in qtest.xhtml that loads much faster (includes a recommendation for localconfig as well).
I hope this helps. Please let me know if you have any more success.
- Dan
--------------------------------------
>I tried the Lively Kernel on the iPad simulator and encountered one
>problem: dragging, eg. moving a window, doesn't work.
>(also tried it on a physical iPod touch - bit slower, but same result).
>
>What _does_ work is tapping the window title bar (until the shadow
>appears) and then tapping somewhere else -> this moves the window to the
>location of the 2nd tap. I couldn't make scroll bars and similar things
>work either.
>
>I assume it's necessary to catch the Touch events:
> -
>http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
> - http://jayantbsai.blogspot.com/2008/09/iphone-svg-events.html
>
>Might be complicated by LK's use of SVG or Canvas.
>
>Questions:
> - is there a version of the Lively Kernel that addresses this?
> - if not - could anyone give me a pointer (ahem) to where
>Javascript/DOM events are translated into Morphic events;
> I've been digging through the source code, but haven't located the
>right place yet.
>
>
>Thanks;
>
>
>_______________________________________________
>lively-kernel mailing list
>lively-kernel at hpi.uni-potsdam.de
>http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
More information about the lively-kernel
mailing list