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
"deviceorientation" works on Surface but needs change of "desktop" detection #18
Comments
(Guess I should just fork parallax but for now tested on jsbin., sorry) I played around with IE11/Surface a bit more: http://jsbin.com/UPiqAJU/33/edit Does seem to work now. IE11 actually has two events:
I tried the DeviceMotion and its event.rotationRate property which seems more like DeviceOrientation on iPad. DeviceOrientation on the other hand gives absolute positions so actually responds to myself "rotating" and not just the device. Not sure how to use this (yet). |
Hi @cthedot, the reason I added the In my opinion it is a far more natural and intuitive experience to use the cursor position on all desktop devices since waving your laptop around is not something you would normally do when viewing a website 😄 However, I totally agree that user agent sniffing is bad practice and this regex is not yet mature enough to cater for all the devices and environments out there...but that's what GitHub is for and I am working as hard as I can to resolve all these compatibility issues. It would be super helpful if you could let me know what User Agent String the MS Surface is spitting out so I can amend the |
...oh and as a side note, most modern smart devices have both the |
regarding |
@cthedot could you please post your User Agent String as per my first comment so I can update the |
hi @wagerfield, I think parallax is one of the first "web" examples where both Device and Feature detection fail. As you said, Device detection/UA sniffing is bad practice. But even if you tried to detect another device like the Surface it would not help. Surface (both RT and Pro) may mainly be used as a tablet (RT maybe even more than Pro but that depends on the user) and would therefore mostly use Just for the record, UA strings: IE11 on Surface both Metro and Desktop version, both with Events: IE11 on Desktop (not laptop): But even if you tried to check for ARM vs WOW64 or Tablet PC 2.0 (which I think is also present if you connect a Wacom tablet) it would not help for the above reasons. As you described the situation with the Mac having Gyroscope and also for the same above reasons feature detection does not work either. I think the only solution is to use both I guess you might ignore MouseEvents for some devices you know for sure they won't be used with a mouse (like maybe iPad, iPhone, Android?, Blackberry?). So a bit the other way round the detection works currently. But even here you do not know for sure e.g. on an Android device or iPad an external keyboard/mouse is used. A better idea I think as both feature nor device detection do help really I think the best thing to do is to let the user decide. Same as in games which have a setting Mouse/Keyboard or Gamepad or Touch there should be a switch to disable MouseEvents or DeviceOrientationEvents. Parallax just would have to have an API to disable one or the other from websites which of course have to provide these settings UI. Hope I did not babble too much and made at least my point clear. Please let me know what you think. Thanks! |
Please rethink this, it won't work :( |
BTW, there is another problem regarding IE11 support. The
|
sorry, did not read your code right. |
Since pretty much every issue associated with this library concerns compatibility, I recognise that this is it's weakest point. Subsequently I am thinking very hard about how I can implement a solution that allows the Also, thanks for your investigations regarding the This is all really great stuff and super helpful @cthedot, so thank you once again! I will let you know as and when I implement some more updates. |
@wagerfield actually it is nice you take the time to listen to this. If I can do anything more just let me know |
does close mean fixed or wontfix? At least the demo still does not work (at least not on orientation, tap on screen works). |
I have been trying to get it work on Microsoft Surface and at least the deviceorientation event is there and works (tested on Surface RT Windows 8.1 Preview IE11, not sure if IE10 also supports this).
The main problem is in the deviceorientation eventhandler:
If you remove "!this.desktop" is does work on Surface which is matched by the desktop detection but is both desktop AND table. I suggest simply detecting the event and event properties is safer than device/userAgent parsing.
I am still working out why the demo works kinda strange and sometimes does not start, maybe it is because of beta nature of IE11, a slightly similar event handling or something else. But generally the deviceorientation event works.
Great work by the way :)
The text was updated successfully, but these errors were encountered: