Do Google Web Toolkit's touch events support Windows tablets?

106 views
Skip to first unread message

Andy Langer

unread,
Jul 27, 2020, 2:53:02 PM7/27/20
to GWT Users
Hi all. Currently working on a webapp using GWT. I currently have a feature working with touch events on a Canvas. The feature itself works perfectly fine on every device but windows tablets (surface pro). Is there something special I have to do for this, or does GWT have no way of doing this?

Michael Conrad

unread,
Jul 27, 2020, 4:02:20 PM7/27/20
to google-we...@googlegroups.com
you will need to check and see what event is actually generated for the windows 10 tablet in the dom and hook those.

On Mon, Jul 27, 2020 at 2:52 PM Andy Langer <mighty...@gmail.com> wrote:
Hi all. Currently working on a webapp using GWT. I currently have a feature working with touch events on a Canvas. The feature itself works perfectly fine on every device but windows tablets (surface pro). Is there something special I have to do for this, or does GWT have no way of doing this?

--
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 google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/940db851-82c2-4f1a-99b8-8ef653d1dadao%40googlegroups.com.

Frank

unread,
Jul 28, 2020, 2:37:34 AM7/28/20
to GWT Users
Maybe you can Google for : JS surface touch events
Or something like that. But for JS. Maybe that can point you in the right direction.
Op maandag 27 juli 2020 om 22:02:20 UTC+2 schreef m.conr...@gmail.com:

Paul French

unread,
Jul 28, 2020, 4:56:59 AM7/28/20
to google-we...@googlegroups.com
When I looked at this 6 years ago (in relation to MGWT, which is dead although we still use it in legacy products) Pointer events were the way to go and are supported on all browsers now as far as I am aware.

There was talk of a single touch/pointer API system in GWT similar to what MGWT did where it took mouse, touch and pointer events and converted to a single touch event system. Hence you coded to MGWT's touch system and it worked on all devices.

No idea if GWT did this in the end.

I assume you are using an old IE Edge? Latest Edge uses webkit under the hood and so your problems may go away with this browser. Older IE Edge as far as I can remember does not support touch events but does support Pointer events.

Take what I say with a pinch of salt. It has been many years but I believe that is why you have an issue.


Craig Mitchell

unread,
Aug 19, 2020, 5:58:03 AM8/19/20
to GWT Users
I had a lot of problems with touch events.  However, they weren't GWT's fault, just different browsers doing different things.

I ended up with this:
// Listen for the screen touch start
mainPanel.addDomHandler(event -> {
handleScreenTouches(event.getChangedTouches(), true);
}, TouchStartEvent.getType());

// Listen for the screen touch move
mainPanel.addDomHandler(event -> {
handleScreenTouches(event.getChangedTouches(), true);
}, TouchMoveEvent.getType());

// Listen for the screen touch end
mainPanel.addDomHandler(event -> {
handleScreenTouches(event.getChangedTouches(), false);
}, TouchEndEvent.getType());

And then kept my own array of what touches are occurring.

I'm not sure if it works fine with a surface pro.  You can try if you like  https://drift.team/  if the game controls work fine (especially with multi touch), then all good.
Reply all
Reply to author
Forward
0 new messages