Friday, September 6, 2019

GWT Support for Touch Event

I'm implementing an online drawing tool using GWT & HTML5. I have handled mouse events successfully and I'm venturing in to handling touch events to cover devices that only fire touch events. I have tried*Events. 

I do notice TouchStart, TouchMove, & TouchEnd events being fired. However, when these events utilized (start drawing, continue drawing, finish drawing; for e.g., a line) handling events become inconsistent. TouchStart is always handled well but the other two, TouchMove and TouchEnd aren't handled consistently. Given below is a segment of code.

// Handle touch start
drawingPaper.addHandler(new TouchStartHandler() {
  public void onTouchStart(TouchStartEvent event) {
    startingPoint = PointerEventHelper.getUsableLocation(event, ...);
    // no device specific code in the method below
    handlePointerDownActionImpl(); /* Consistently getting called */
}, TouchStartEvent.getType());

// Handle touch move
drawingPaper.addHandler(new TouchMoveHandler() {
  public void onTouchMove(TouchMoveEvent event) {
    currentLocation = PointerEventHelper.getUsableLocation(event, ...);
    // no device specific code in the method below
    handlePointerMoveActionImpl(); /* Call to this is inconsistent */
}, TouchMoveEvent.getType());

I'm using browsers like Chrome, Firefox, Duck Duck Go, Bravo, Opera, and Opera Mini on my Pixel 2 and Samsung Galaxy Tab A.

Any suggestions would be very much appreciated.

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

No comments:

Post a Comment