I just discovered that touch events are not registering in Chrome. This is a known issue and the solution is easy (for most users):
- Type chrome://flags in the address bar of Chrome
- Press Ctrl+F and search for Touch in the search box that opens up on the right
- Change the “Enable Touch Events” setting from “Automatic” to “Enable”
Which touch events are you referring to ? I have an Asus Transformer with a plain run off the mill Chrome 47 I just installed, and it responds well to such things as swiping for before/after, scroll with two fingers, and a click on a button.
I checked in flags, Enable Touch Events is set by default as “Automatic”, which should enable it on any machine that reports being able to support touch interface.
I am not aware of any way to set that in code. Maybe the most elegant way is to instruct the user the way you did in your post, if he cannot access touch.
I think it is a glitch in Chrome 47 (works fine in other browsers). Touch events used to work in Chrome. My guess is that they changed something so now it isn’t detecting that there is a touchscreen.
My users will struggle with even the simplest instructions. In general, we have novice users. That’s why this is such a pain.
At the very least, is there some way in Xojo to detect presence of touchscreen? Not sure what that will get me but just thought I’d ask.
Xojo Web runs inside the browser, so if the browser can’t detect a touch screen then there would be no way for the web app to know either.
A workaround might be:
Test the useragent string for that exact combination of OS and Browser.
If they match, pop a modal that asks them to touch the OK button (don’t make it default, so the keyboard can’t) and give a five second countdown.
If it’s not clicked after 5 seconds, show instructions for enabling touch events, and open a new tab with the url
Set a cookie once they can interact with your app, so you don’t constantly ask the same person over and over if they can touch the screen.
I repeat : it works just fine in 47.0.2526.111 I just installed a few minutes ago under Windows 10.
Unfortunately, that does not work from a Xojo web app.
From my experience with Chrome just now, I am inclined to think Chrome is alright, and the issue maybe a fluke.
Michel - As you indicate, this issue only affects some computers. I have a Lenovo Ideatab that still works in Chrome 47.
Tom - I like your idea; seems like all I can do. Maybe I could have a "Touchscreen Test " button that opens up the popup with instruction to “Touch Here” and text that says “If nothing happens, click here for instructions on enabling touch.”
Thanks for the input.