Is there any DOM event in Webkit associated to trackball events (movement and pressing)?
Or is there any other way to handle those events from a webpage?
Is there any DOM event in Webkit associated to trackball events (movement and pressing)?
Or is there any other way to handle those events from a webpage?
I haven't tested it, but I do know that inside the Android API, the trackball eventually gets sent as DPAD_UP,DOWN,LEFT,RIGHT. These might map to your javascript arrow keys. A press event might be left click or RETURN.
EDIT
I've created a super simple page that will log to the android log file whatever input events are seen on the page. http://imaiparrott.org/bugs/input.html. Go there in your Android browser and play around with input events and view them in adb logcat. From what I can see, my trackball doesn't get registered at all for any events. You might be out of luck...
On the other hand, depending on what exactly your site is, I can think of one hacky way to do it... The trackball focuses DOM objects that are focusable. If you have the kind of page that doesn't need standard DOM objects being focusable (like a game perhaps) then you could create a couple sort of 'hidden' DOM objects and listen to the DOMFocus events for them. With a tricky combination of events from that you could figure out which trackball event was fired.