iPad: mouse vs touch events

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

iPad: mouse vs touch events

Werner Schuster (murphee)
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;



Reply | Threaded
Open this post in threaded view
|

Re: iPad: mouse vs touch events

Dan Ingalls-4
[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
>[hidden email]
>http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel