I have a MouseDownHandler, MouseMoveHandler, and MouseUpHandler attached to a panel. I’d like to get the corresponding touch events to work the same way too. Is there any example of how this works with GWT?
The events and handlers section in the docs are quite sparse:
https://developers.google.com/web-toolkit/doc/latest/DevGuideUiHandlers
so I must be missing it somewhere,
Thanks
—– Update ————
Ok so added this, but it doesn’t fire:
// touchTest is just a div with width/height = 100%
RootPanel rp = RootPanel.get("touchTest");
rp.sinkEvents(Event.TOUCHEVENTS);
rp.addHandler(new TouchStartHandler() {
@Override
public void onTouchStart(TouchStartEvent event) {
// touch down!
}
}, TouchStartEvent.getType());
I have a mousedownhandler attached to the div like above, and it works fine when run in a desktop browser. Is there soething else we need to do?
Thanks again
This is for 2.5 but it’s the similar of same for 2.3-2.4 I believe.
Here’s the event
touch event
and the handlers
touch start
touch end
touch cancel
touch move
touch all Note: For touch all there is a warning: