Re: [csswg-drafts] [mediaqueries-5] detect keyboard navigation abilities

As far as I know, the following cases exist:
* smartphone / tablet / watch browser: no keyboard, no spatnav
* most desktop browsers: keyboard present, no spatnav
* a few desktop browsers (Presto Opera, Vivaldi): keyboard present, spatnav on shift+arrow
* TV browsers: remote control, spatnav on arrow keys

In all these cases, you know how to answer that media query without having to ask anything from the OS.

There's possibly an exception with laptop computers with a touch screen and a detachable keyboard. If a browser with spatnav was running on one of these, you should return true for `@media (nav:spatial)` when the keyboard's in, and false when it's disconnected. But if you can still do spatnav from the software keyboard, maybe it should still be true.

Anyway, you can detect that:
* Windows: https://blogs.msdn.microsoft.com/oldnewthing/20150720-00/?p=90871
* Android: https://stackoverflow.com/questions/2415558/how-to-detect-hardware-keyboard-presence

I am sure that for other OSes where this sort of thing might happen, there are APIs as well.


-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1911#issuecomment-341615996 using your GitHub account

Received on Friday, 3 November 2017 03:34:24 UTC