Platform/AreWeFunYet: Difference between revisions

Jump to navigation Jump to search
Implementation status: bug 865649 was fixed
(standardization efforts of key event scan codes)
(Implementation status: bug 865649 was fixed)
 
Line 267: Line 267:
= Keyboard input that ignores keyboard layouts =
= Keyboard input that ignores keyboard layouts =


Owner: Mounir Lamouri
Owner: Masayuki Nakano


Many games use the WASD keys for direction control. However, depending on the active keyboard layout, their usual (US-layout) key places can be occupied by different letters. In the [http://en.wikipedia.org/wiki/AZERTY AZERTY] keyboard layout, for example, these keys have the letters ZQSD, and in [http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard Dvorak] {comma}AOE.
Many games use the WASD keys for direction control. However, depending on the active keyboard layout, their usual (US-layout) key places can be occupied by different letters. In the [http://en.wikipedia.org/wiki/AZERTY AZERTY] keyboard layout, for example, these keys have the letters ZQSD, and in [http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard Dvorak] {comma}AOE.
Line 274: Line 274:


Standardization:
Standardization:
* Apparently [https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#keyboard-events DOM 4 Events] attempt to spec this. I don't know the status of this spec. I've found [http://lists.w3.org/Archives/Public/www-dom/2013JanMar/0160.html Masayuki Nakano's critique from February 2013] but don't know if there are recent developments that address his concerns.
* Spec at [https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#keyboard-events DOM 4 Events]


Competition:
Competition:
* unknown
* unknown


Implementation idea:
Implementation:
* We could expose an attribute 'scancode' to the KeybordEvent interface. The scancode is the code of the pressed key as the hardware see it. Unfortunately, that code is likely hardware dependent and clearly OS-dependent. We have an experimental patch that use that but doesn't return the same value on Mac and Linux (not checked on Windows).
* This was implemented as keyevent.code in [https://bugzilla.mozilla.org/show_bug.cgi?id=865649 bug 865649] and targets Firefox 32.
* We should then find something else. Any idea is welcome.
* Suggestion: The platform attempt to map the OS scancodes to a new, web-safe scancode set based on the USB scancodes (or some subset thereof). These web-safe scancodes should then be documented and submitted for standardisation. The API should make it explicit that a scancode is not guaranteed to be provided, and that authors should provide a sensible fallback, such as using the keycode and assuming a QWERTY layout, if it is not.


Relevant links:
Relevant links:
Confirmed users
85

edits

Navigation menu