New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
touch class placed on all browers on windows 8 on a regualr pc with no touch support #880
Comments
|
Could you create a jsFiddle which reproduces this? Note that |
|
It's possible that Firefox and Chrome have enabled the touch APIs by default on Win 8 now... I'll ask around. In which case, this isn't a false positive. |
|
Hi, Since today I have the same problem with chrome 26 and firefox 20! Is there an other way to detect touch screens with modernizr? |
|
I can also confirm this behavior as well. Using Windows 8, inside a VMWare virtual machine, on MBP. Seems like the touch API detection isn't enough for what people need to use it for, or there needs to be a better combination of detection for devices that aren't Smartphones/Mobile, but are touch enabled (tablets, ultrabooks, Win8 devices). |
|
@fitli65 But still, I've confirmed with the Chrome guys that they still disable the API when there's no touchscreen on Win 8, so I'm surprised this is Can you let me know what you see here? http://codepen.io/anon/pen/JAsdy (for some reason the 'pen' and 'full' views of that show different results on my Macbook Air?!) |
|
Tested on MBP, Win8 VMWare, Chrome stable: |
|
@stucox FWIW - Just tested the codepen link on an iPad, identical results to the Win8 virtual machine/Chrome stable. |
|
iOS (iphone/ipad) console: Windows 8 VM, Chrome Stable console: OSX, Chrome Stable, Safari latest, console: From these results, it seems like you could infer that the "object" was created by the OS, because it is/has a touch screen. When it does not need to be created, like on the virtual machine, it appears the browser, just leaves the "function" un-executed... I could be wrong though, just the observations telling me what to do. |
|
PR Here: #920 |
|
I continued to look at alternative ways to properly detect this. I tried |
|
@woutergovaert – the results you saw... were they in a VM by any chance? Chrome and FF on Win 8 on BrowserStack report |
|
The results I got where on a vm indeed. It seems strange that the browser would react differently but not impossible. Verzonden vanaf Samsung Mobile -------- Oorspronkelijk bericht -------- @woutergovaert – the results you saw... were they in a VM by any chance? Chrome and FF on Win 8 on BrowserStack report false for Modernizr.touch, and false for all 3 line in the Codepen above... so I don't believe these browsers naturally expose the ontouchstart API on Win 8. I wonder if VMWare is telling Win 8 it has a touchscreen regardless... — |
|
Seems almost like the OS is what is doing it... I did also confirm however, On Sat, May 4, 2013 at 8:40 AM, woutergovaert notifications@github.comwrote:
|
|
Well, something strange is going on. I have a Windows 8 notebook with touch, and in Chrome 26 ("Emulate touch events" disabled) I can attach a handler to |
|
The way this is supposed to be working in Chrome is as follows:
On Windows we use the GetSystemMetrics(SM_DIGITIZER) API and see if it returns NID_READY | NID_INTEGRATED_TOUCH (source here: https://code.google.com/p/chromium/codesearch#chromium/src/ui/base/touch/touch_device_win.cc&q=IsTouchDevicePresent&sq=package:chromium&type=cs&l=12). It sounds to me like Windows 8 is returning this as true even when there's no touchscreen? I hear having the Visual Studio simulator installed can cause Windows to lie and behave as if there is a touchscreen when there isn't (http://stackoverflow.com/questions/13004911/how-to-specifically-detect-a-touch-screen-display-on-windows-8), any chance that's what's going on? |
|
Thanks for the info all. @tvpmb – could you give us some more details about a) the VM setup you're using (including settings/services in use) and b) the Toshiba laptop you also saw a problem on? (again, services in use) Apparently the SMART Board service and some other virtual touch drivers can also cause the OS to report that a touch device is connected. It looks likely that this will be moved to a Chromium ticket, or some tickets aimed at various vendors. Modernizr's doing its job here: detecting the Touch Events APIs. Ultimately, this is yet another reason why |
|
If you need further reports... a clean instance of Win 8 (not touchscreen, not a VM) with Firefox 20 returns |
|
I, also don't have a real Win( machine. Who does? But in Win8, the Image from modern.ie, and Paralells all the test return false in IE10 and FF20. |
|
@stucox The virtual machine is just a bone stock Win8 Developer's Preview from Microsoft. It is installed using VMWare Fusion 5.03. Nothing else is installed but Chrome stable. The Toshiba laptop is a 17" Satellite p875-s7200. Aside from that I don't have much more information, except it was running Chrome stable. It belongs to a friend of a friend, so getting my hands on it will be harder, but they experienced this problem in our live application the other day. IE 10 does work properly, so this one is a bit of a bummer altogether. |
|
Thanks. As I say, I'm not treating this as a Modernizr bug... it looks like it's detecting the API correctly. But I'm still keen to get to the bottom of it. What's your use case? |
|
Above, @RByers said how they're detecting touch. It uses SM_DIGITIZER. If you read the [MSDN page](http://msdn.microsoft.com/en-us/library/windows/desktop/ms724385(v=vs.85\).aspx) it has this description:
I looked on my Windows 8 PC and there is no such service, but there is the "Touch Keyboard and Handwriting Panel Service" which sounds similar. Go to Control Panel, Administrative Tools, Services and find that service. Stop it, restart the browser, and see if that makes the problem go away. If so, set the service to Disabled so it won't restart. |
|
Just tried this on my VMWare Win8, disabled the "Touch Keyboard and On Tue, May 7, 2013 at 1:57 PM, Dave Methvin notifications@github.comwrote:
|
|
I have made a detection script, you can get it here: https://dl.dropboxusercontent.com/u/2024878/dtouch.exe Run that in your Windows 8 VM and see what it says. On my touch-capable Windows 8 system I get this: If you get anything other than zero, it means that Windows thinks the system is touch capable. The [MSDN page](http://msdn.microsoft.com/en-us/library/windows/desktop/ms724385(v=vs.85\).aspx) has the bitmap decoding for the SM_DIGITIZER value, that may tell a bit more about why it is reporting that. But if you DO get something other than zero then I agree with @stucox that it's not a Modernizr problem or even a Chrome problem. |
|
Hello all I don't think this is only a WIN8 Problem... Chrome: 26 Firefox: 20 Safari: 5.1 IE10: On my Laptop (HP HDX18 and also Win8 installed) I don't have any problems! @dmethvin: I dont't find a service like this in german system... and your dtouch.exe doesn't work on my computer... It says MSVCR110.dll is missing an has to be installed... |
|
@fitli65 said:
The results I've seen so far in this thread suggest to me that Chrome and Firefox are probably both using the same Windows system parameter(s) to determine the presence of a touchscreen, and that there are cases when these can't be trusted. Safari and IE10 don't support the Touch Events API, so we'd expect them to return I agree we shouldn't assume that it's solely Win 8 which could be affected by this kind of thing though... any platform could suffer from inconsistent settings and services messing with things. |
|
I found the problem! On my computer I tested the Logitech Wireless Touchpad T650 a while ago. But did not use it much... So I removed it again. But I found out, that in the Logitech Unifying Software the Touchpad was already there and I had to unlock it first. After a reboot Firefox and Chrome act normal again! :o) Maybe this info helps others ;o) |
|
Glad to hear that things are fixed, fitli65. Were you able to run the diagnostic that dmethvin posted? -https://dl.dropboxusercontent.com/u/2024878/dtouch.exe I'd be very curious to know what the "Logitech Wireless Touchpad T650" is reporting under SM_DIGITIZER. |
|
@egirard: No, I was not able to run the tool... I got the error message: " MSVCR110.dll is missing an has to be installed" |
|
Try it now, I recompiled with static linking to circumvent DLL Hell. https://dl.dropboxusercontent.com/u/2024878/dtouch.exe |
|
@dmethvin: Sorry! But I don't have the Touchpad anymore... Now (after unlocking it) my computer sais: SM_DIGITIZER: 0x00000000 (0) |
|
The SM_DIGITIZER flag is used by Chrome to decide if there's a touch screen active and available. Specifically, we're looking for NID_INTEGRATED_TOUCH (0x01) and NID_READY (0x80). Thanks for patching the utility, @dmethvin - this makes for an excellent diagnostic tool. |
|
To wrap up: The consensus here seems to be that these are instances whereby the browser is fooled into thinking a touch device connected. Modernizr certainly can't do anything about this and I suspect there's not a lot the browsers can do either. However, if anyone has sufficient information to chase this up with driver and VM vendors, that'd be great. In any case, See my blog post on the issue of detecting touchscreen devices here: http://www.stucox.com/blog/you-cant-detect-a-touchscreen/ |
|
Just had the same problem when testing a project on PC Win 7, Chrome 27 I have drivers installed for a "pen" and even though it's not connected to the computer, Chrome somehow thinks, that it should support Touch Events. (Earlier versions of Chrome didn't do this.) Thanks to the comments above I looked at the services running on the PC and after stopping the service "Tablet PC Input Service" and restarting Chrome, the "no-touch" class was added again. So, as also mentioned in comments above, it's a problem in the way Chrome (and maybe other browsers) determines, if the OS has a touch device connected. |
|
Ok thanks, I'll pass this info on to the Chrome team – although, as stated earlier, Chrome gets this information from the OS, so there probably isn't a lot they can do about it. Again, it seems to be better all round if we don't treat the presence of touch APIs as a reliable test of whether or not the device has a touchscreen. |
Style navbar toggle button Style navbar toggle manually instead of with button classes Style navbar Modify color Turn off all tooltips for touch devices Style main nav Fix scrolling navbar collapse Style tweaks Minor tweaks Style no ssh key message




No description provided.
The text was updated successfully, but these errors were encountered: