views:

181

answers:

2

Hi folks,

wondering here if there is a way I could trigger an event, so that any library listening for these events (e.g. jQTouch, Sencha touch, iUI, ... ).

If I could extend or use jQuery for such task e.g. $(...).trigger('event') that would be great to know.


Usage example:

I need to debug a few web apps by simulating multi touch with my mouse. This seems a little complicated, so if I could trigger the multi-touch events using Javascript I could therefore test the app more efficiently.


Any ideas guys? =D

+1  A: 

The Android Code Monkey might already do what you're looking for...

Brad Hein
@Brad: Thanks for that! I'll check it out =) A javascript library that can be run from within the webpage would awesome.
RadiantHex
Wait, you mean a webpage that runs javascript to simulate user input?
Brad Hein
@Brad: said like that it sounds like a silly question :) It's just that I don't know how to go on about multi-touch.
RadiantHex
No silliness intended :) I was just trying to better define the question after noticing you wanted a solution that worked on not just Android. I don't think JavaScript is given rights (by the Browser/OS) to inject user inputs into a device's keyboard/touch/mouse input buffer. You may have some success with a custom "test harness" app, but it probably can't be written in JS :/
Brad Hein
+1  A: 

Not sure if this is in webkit, but it may be useful: https://developer.mozilla.org/en/DOM/element.dispatchEvent

Lets you fire events such as 'click', so if the function exists in webkit then it should also work for touch events.

Adam Heath
@Adam: Thanks for this! It would be really good to know if it works with multi touch events. I'm gonna have a good look at this thanks again!! =)
RadiantHex
Note that Android does not currently support multitouch events: http://www.quirksmode.org/mobile/tableTouch.html
Adam Heath
Android does support pinch/spread but not true multi-touch
Michael Mullany