Thursday, February 27, 2014

Re: Chrome Touch Emulation and GWT

See https://developers.google.com/chrome-developer-tools/docs/mobile-emulation:  Note under 'Emulating Touch Events': "elem.ontouch* handlers will currently not fire with this feature. Use the --touch-events command line flag to let Chrome trigger these handlers."

On Wednesday, February 19, 2014 11:12:52 AM UTC-5, Alexander Zbiek wrote:
Hi all,
hope it is not wrong to post a question here.

I have a problem with touch events when emulated via the Chrome Emulation. I have a simple Canvas with an added Touch Handler:

     final Canvas ca=Canvas.createIfSupported();
    ca
.setCoordinateSpaceWidth(wiCo);
    ca
.setCoordinateSpaceHeight(wiHe);
//    ca.sinkEvents(Event.TOUCHEVENTS);
    ca
.sinkEvents(Event.ONTOUCHSTART);    




    ca
.addTouchStartHandler(new TouchStartHandler() {
 
@Override
 
public void onTouchStart(TouchStartEvent event) {
 
// TODO Auto-generated method stub
 
Touch t=event.getTargetTouches().get(0);
 ca
.getContext2d().setStrokeStyle("#fff");
 ca
.getContext2d().clearRect(0, 0, 800, 200);
 ca
.getContext2d().setStrokeStyle("#000");
 ca
.getContext2d().strokeText("Move "+(t.getPageX()-ca.getAbsoluteLeft())+","+(t.getPageY()-ca.getAbsoluteTop()),10,60);
 consoleLog
("Touch move ");
 
}
 
});


It works perfect on my Nexus7 but it doesnt work on my chrome when emulating Nexus7 and touches. Other Touch web apps (nativ JavaScript ? ) work in Emulation mode. But my (working) GWT app doesnt react to the (emulated) touch events. :(

Any experiences with it?

Many thanks in advance
     alex

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment