Q: How do you tell the difference between a mouse and a touchscreen?



  • A: Use Google Chrome.

    I still can’t figure out the how or why of this, but I’ve reached the conclusion that Google Chrome can tell the difference between a click generated by a mouse and a “click” generated by tapping a touchscreen even though Windows sees them both as mice.

    The situation: a museum display that uses a computer with a touchscreen to run an interactive display. The software that runs on this is client-server combination so that the content can be modified from a computer in another part of the building. This software is a horrible piece of shit both on the server and client sides, with a user interface to match on both sides as well.

    I volunteered to replace this by something more usable and more easily expandable. To do so, I chose a PHP-based web site, on the basis that it will allow museum staff to simply put files into directories on the server to make them visible on the client (thereby avoiding the need for staff to learn how to use software to manage all this), while giving the freedom for the client side to use any OS that runs a modern web browser and allowing the whole thing to be maintained by future generations of museum volunteers. I won’t claim my efforts are any better than the original code-wise, but they certainly are as far as usability is concerned.

    When I’d finished setting up the server side early this afternoon, it was time to do the client. I’d picked Chrome as my choice of browser, since it has a built-in kiosk mode (--kiosk --kiosk-printing — don’t ask me why it needs both those switches). After all kinds of trouble getting it to install on the computer¹ it turns out it didn’t respond to taps on the screen. After a lot of investigating, I can only conclude that Chrome can somehow tell that the touchscreen isn’t a mouse — even though every other program on the computer responds to it as if it is.

    I can hear you think: well, duh, it’s a touchscreen — Windows will know it is. Possibly, but the only place in Windows where I could find any reference to the touch capabilities of this screen, is in the mouse part of the system settings. The computer claims it has two mice connected to it: one generic PS/2 type and one [url=http://www.inexio.co.kr]iNexio[/url] blah blah blah USB mouse. It gives every impression that the screen’s driver simply tells Windows “I’m a mouse, and somebody just moved the pointer here and clicked.” It certainly doesn’t use Windows’ pen/tablet settings — tapping the screen doesn’t give those little circles where you tap, even though I checked that that setting is on.

    Chrome turns out to have some flags for touch devices, but setting those also makes no difference — yet at the same time, the damned thing refuses to treat a touchscreen that seems to claim to be a mouse, as a mouse …

    End result: the screen now has a piece of paper on it that says it’s out of order until we can figure out WTF is going on here.²

    ¹ Not caused by Chrome but by an F-Secure virus scanner that was about four years out of date, claiming Google Update.exe contained a trojan. I’ve not figured out why somebody back then decided a computer that is in a network with exactly one other computer — a network that’s isolated from the rest of the world — needs a virus scanner. I figure they thought, It’s Windows, slap one on.
    ² Turning the old software back on should be possible, but in tinkering with the network settings on the server I must have broken something that it depended on, as the client side wouldn’t do more than give a blank screen. Oops.



  • Is this relevant?

    @Gurth said:

    Chrome turns out to have some flags for touch devices, but setting those also makes no difference
    Was one of those the "Enable Touch Events" flag?

    (No idea why I am posting this, as you obviously did this yourself - just in case, I guess?)


  • sockdevs

    @Gurth said:

    even though Windows sees them both as mice.

    windows knows one's a touch screen. It reports the touch screen as both a mouse and a touch screen because older programs don't know about touch screens but do know about mice.



  • Yes, the #touch-events flag that you can set to automatic, enabled or disabled. Searching the net, I discovered that Chrome in its latest versions apparently has trouble with Windows pen settings unless you set this flag to something other than automatic — but like I said, this particular touchscreen doesn’t use those, so I guess that’s why the flag had no effect either.



  • @Gurth said:

    don’t ask me why it needs both those switches

    It may have changed since then, but reading some old information suggests that --kiosk is for Chrome OS only and is meant for demoing Chromebooks in retail stores. That's one big :wtf: for Chrome - why does this flag do something completely unintuitive!?


  • Impossible Mission Players - A

    @Gurth said:

    I chose a PHP-based web site, on the basis that it will allow museum staff to simply put files into directories on the server to make them visible on the client (thereby avoiding the need for staff to learn how to use software to manage all this)

    This sounds oddly familiar to a site I scratched together to display a "dynamic" slideshow...


    Filed under: Each browser that uses the site controls the slideshow. It even sends the Refresh command to all the other shows, so they're always perfectly sync'd!



  • I applaud your intent but you seem to have painted yourself into a corner thereby leaving you up a, not very nice smelling, creek without a paddle.

    You stated that you intended the client to be non specific to the server or software, I.e. Anything capable of running a browser which, simply put, is similar to my own desires in providing "software".
    You imply you have only tested it with chrome and it don't work. You state that there is only one client and you indicate that the "system" is not working because of it.

    Have you tried other browsers, or older versions? After all, with one client you can be very specific, at least until you get a fix.

    The other obvious question, and I am sorry if I am using @accalia cluebat to beat you around the head, but did it work whilst you developed it? If so what has changed?



  • @accalia said:

    windows knows one's a touch screen. It reports the touch screen as both a mouse and a touch screen because older programs don't know about touch screens but do know about mice.

    Aha. I couldn’t find anything else related to the touch screen in Windows’ settings, but I may have overlooked something. Will have to check sometime soon …

    @loose said:

    You imply you have only tested it with chrome and it don't work. You state that there is only one client and you indicate that the "system" is not working because of it.

    I tested it in Safari, Chrome and Firefox on my own computer, and it worked fine in all of them — but I don’t have a touchscreen like the one in the museum. What is a (IMHO minor) failure of mine is that I didn’t expect that a browser responds differently to a touchscreen, but OTOH, I don’t think I could have seen that one coming anyway.

    As for using other browsers: I tried some on the museum computer. Firefox works, but is almost unusable because it requires you to touch the screen and lift your finger off cleanly, without moving it on the screen at all — moving by even one pixel between pressing and releasing the screen appears to be treated as a drag rather than a click. In addition, it didn’t play the videos (which are in MP4 format) even though my Firefox at home does … this is probably a matter of a plugin, though.

    The site worked in the version of IE on the computer, but that’s so old that it doesn’t seem to know CSS3; I could live without the animations, but not with everything being positioned as if no dimensions are supplied at all (since I scaled much of it using vw and vh measurements). IIRC it also had some other problems, but I don’t quite remember what they were. In any case I wasn’t in a position to test the site under IE on my computer at home, and so don’t want to run the live version under it either before I can actually test it and make sure it works correctly.



  • You are listening for touch events,right?
    It's a huge cluster fuck, I remember having similar problems before. AFAIR I fixed it by adding a few events to the click handler..



  • i can understand your pain.

    My next PHP Server driven project assumes, nay, requires User Input to be via touch, Either via browser or dedicated App from a mobile device.

    I, therefore, fully appreciate your detailing some of the "unexpected" pitfalls. Thank you,


  • sockdevs

    @loose said:

    I am sorry if I am using @accalia cluebat to beat you around the head,

    ..... @accalia does not appreciate being used as a cluebat and is giving you three seconds to let go of her tail before she is forced to maul you.

    :rofl:



  • Ok, let's see if this can be fixed...

    "...using @accalia's cluebat..."


  • Discourse touched me in a no-no place

    @accalia said:

    @loose said:
    I am sorry if I am using @accalia cluebat to beat you around the head,

    ..... @accalia does not appreciate being used as a cluebat and is giving you three seconds to let go of her tail before she is forced to maul you.

    :rofl:

    I hear if you swing an @accalia around by the tail fast enough she can't turn on you before you stop.



  • If you let go while swinging her fast enough, you might be able to throw her far enough that you can get to safety before she can turn and get to you.



  • @FrostCat said:

    I hear if you swing an @accalia around by the tail fast enough she can't turn on you before you stop.

    The evil ideas thread is :arrow_double_up::arrow_down_small::fa_backward::arrow_backward::arrow_right_hook:



  • @LB_ said:

    old information suggests that --kiosk is for Chrome OS only and is meant for demoing Chromebooks in retail stores

    I just tried Chrome with the --kiosk-printing switch only, and that just launches it in a window — whereas only --kiosk put it (as I recall) in fullscreen mode but with titlebar and tabs on Windows, while on my Mac it does hide those. Weird.

    @swayde said:

    You are listening for touch events,right?

    Time to own up that I don’t, I suppose … since I kind of took it for granted that Windows treated the touchscreen as a mouse, I didn’t see a need to specifically code for touch events. Which, though, still doesn’t make Chrome less of a :wtf: for treating them differently when literally every other program I tried on the machine doesn’t differentiate between them at all (that’s my excuse, anyway ;)).



  • @swayde said:

    You are listening for touch events,right?
    You're seriously suggesting overriding the browser's hyperlink handling and doing it the Discourse way? :doing_it_wrong:

    If it's the only option...


  • sockdevs

    @FrostCat said:

    hear if you swing an @accalia around by the tail fast enough she can't turn on you before you stop.

    I hear that if you do that your chances of being targeted by flying fox drones increases ten billion percent



  • @accalia said:

    I hear that if you do that your chances of being targeted by flying fox drones increases ten billion percent

    Yeah but there would be a typo when the target was set, so the drones would end up somewhere else anyway.


  • Discourse touched me in a no-no place

    @accalia said:

    I hear that if you do that your chances of being targeted by flying fox drones increases ten billion percent

    BRING IT! I haven't had a good THAAD test in a while!


  • sockdevs


  • Discourse touched me in a no-no place

    I was expecting more sort of a "oh, it is broughten!"


  • sockdevs

    @FrostCat said:

    I was expecting more sort of a "oh, it is broughten!"

    i was lelazy and had already GIS'd that gif. :stuck_out_tongue:



  • @loopback0 said:

    Yeah but there would be a typo malfunction, since this is set in Dissedcourse and Jeff is involved when the target was set, so the drones would end up somewhere else anyway self-destructing.

    FTFY



  • I assumed that @accalia's fox drones weren't Discopowered.


  • BINNED

    I hear they run on @sockbot code



  • @‍Jaloopa has summoned me, and so I appear.

    <!-- SockBot/2.11.3 (Cheery Chiffon; owner:accalia; user:sockbot) 2015-11-02T09:03:18.582Z -->


  • Ok, I think I've got it:

    How do you tell the difference between a touchscreen and a mouse?
    One of them is a watemorous(sp?) interface, and the other is in a morris water maze.



  • I don't know what your setup is doing but my laptop has a touchscreen and mouse events are the same ones as click events on Chrome.



  • @Eldelshell said:

    I don't know what your setup is doing but my laptop has a touchscreen and mouse events are the same ones as click events on Chrome.

    Ditto. Touch "just works" on Chrome (win8.1, normal chrome window - no kiosk settings)



  • @Buddy said:

    watemorous

    What, amorous? :giggity:



  • It’s gotten weirder. According to the Dutch importer of the said touchscreen, the screen installs itself as a mouse — not as a touchscreen or other similar device — and they’re not aware of any problems. Their advice was to see if we could download a version of Chrome that does work … I take it their thinking is, “They’re using an old version, let them grab the latest and that should solve whatever it is.” Except that I had already installed the latest version of Chrome.

    Earlier tonight I checked what hardware Windows claims is attached to the computer, and the only devices in any way relevant to this are a generic PnP screen and an iNexio mouse. Yet Chrome keeps ignoring clicks on the screen, but not those of the PS/2 mouse.

    Luckily, though, I found a solution that will make the whole thing at least usable: Firefox only fucks around when you tap on an <a>, not on a <button> — probably because you can drag an anchor to create a shortcut to the page on your desktop (or wherever) but you can’t drag a button. So, all I’ll have to do is change all of the former to the latter and it should work. (Though I wonder what’ll happen with an <img> on a button. But I can test that at home, at least.)


  • sockdevs

    @Gurth said:

    According to the Dutch importer of the said touchscreen, the screen installs itself as a mouse — not as a touchscreen or other similar device

    well there's TRWTF

    among other things the input from a touch device is fuzzier than that of a mouse, so you have to adjust your tollerances to deal with that properly. if the device reports itself to be a mouse (how? it's a touch screen so all the pointing has to be via absolute positioning, not the relative of a mouse, unless they only support one touch point, keep the mouse position in firmware and zoom it all over the place on touch events.)



  • @accalia said:

    they only support one touch point, keep the mouse position in firmware and zoom it all over the place on touch events

    You, madam, appear to be today’s winner.

    The screen isn’t multi-touch, and if you press it anywhere, the mouse pointer immediately jumps to that point. This was hugely distracting in the old software that I’m aiming to replace, because it looks stupid on a full-screen application to be reminded you’re actually working with Windows. OTOH, the Windows scroll bars on the text boxes didn’t exactly hide that either.


  • Impossible Mission Players - A

    @accalia said:

    keep the mouse position in firmware and zoom it all over the place on touch events

    A VNC client I use does this when the cursor leaves the viewer area. It slams the mouse to the top-right corner of the screen, and when you enter back in tries to slam it back to wherever the mouse currently is.

    Of course, this doesn't work in any OS that that's not using 1:1 mouse translation (i.e. "acceleration" is turned on or the "speed" is anything but 0/default/null) or is otherwise unaware that the VNC session should be using absolute-positioning.


  • Impossible Mission Players - A

    @Gurth said:

    stupid on a full-screen application to be reminded you’re actually working with Windows

    Every time I discover this on a Kiosk I usually make a few attempts to break out into the desktop, just for kicks and :giggity:s.


  • sockdevs

    @Gurth said:

    The screen isn’t multi-touch, and if you press it anywhere, the mouse pointer immediately jumps to that point. This was hugely distracting in the old software that I’m aiming to replace, because it looks stupid on a full-screen application to be reminded you’re actually working with Windows.

    ah.... well then....

    yeah that's going to be fun.

    I don't suppose there's any budget for a hardware swap for a proper touch screen device?



  • Hence my intention to put cursor: none into the style for the site’s <body> tag.

    And on that note: another touchscreen in the same museum was donated by some or another part of the provincial government. This works fine, using Windows pen control stuff — but they didn’t lock the thing down at all, so fairly regularly a staff member has to restart the application it’s supposed to be showing. They even suggested hooking it up to the internet, so users could access more information on the subject displayed on the screen. That was shot down really quickly by the museum staff with the words, “We don’t want some joker to make it show porn.” That point, apparently, hadn’t even been considered before …


  • Impossible Mission Players - A

    @Gurth said:

    hadn’t even been considered before …

    Apparently the provincial government must be living in said museum. Even :giggity: Engine would catch on to that!



  • @accalia said:

    I don't suppose there's any budget for a hardware swap for a proper touch screen device?

    Not until this one gives up the ghost, I’d say.

    @Tsaukpaetra said:

    Apparently the provincial government must be living in said museum.

    If they would, they’d see the kind of things people try on their screen rather than what they’re supposed to be doing on it.


  • Impossible Mission Players - A

    @Gurth said:

    they’d see
    Maybe. Are you sure they wouldn't still be posturing and slandering so much they wouldn't even be able to tell they were in a museum?



  • Quite probably. Not that I have any idea which part of the government subsidised that screen, but it sure doesn’t seem to be one of the hands-on sections.


  • sockdevs

    @Gurth said:

    Not until this one gives up the ghost, I’d say.

    Pitcher of water, meet sensitive electronics.

    Sensitive electroniucs, meet piutcher of water.



  • @Gurth said:

    and if you press it anywhere, the mouse pointer immediately jumps to that point.

    I worked somewhere years ago which had a touchscreen that worked like that. IIRC it actually showed up as a touchscreen in Device Manager too.



  • @accalia said:

    electroniucs



  • Suggested workaround: use a Javascript onmouseover event on all the <a> tags to fire the click event.

    Filed under: I'm only slightly kidding.


  • Impossible Mission Players - A

    @anotherusername said:

    use a Javascript onmousehover

    FTFY.



  • There isn't a hover event, but that's no biggie. If it's firing all the events of everything it crosses over to get to the touch point, just set a timeout and use the onmouseout event to cancel it.


  • Impossible Mission Players - A

    @anotherusername said:

    use the onmouseout event to cancel it.

    This is sounding suspiciously like M$ Kinect programming...


    Filed under: Where's my growing spinner-hand?



  • @Tsaukpaetra said:

    @Gurth said:
    stupid on a full-screen application to be reminded you’re actually working with Windows

    Every time I discover this on a Kiosk I usually make a few attempts to break out into the desktop, just for kicks and :giggity:s.

    I once rebooted one using only the touch screen.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.