[w3c/uievents] Add specification for AltGraph key & modifier behaviour (#147)

The UI Events specification caters for a variety of modifier keys, including AltGraph (also known as ISO Level 3 Shift). In general how modifiers (e.g. Shift, Control) affect input is fairly consistent and well understood across platforms.

AltGraph is a more complex case on some platforms, and user agents typically expose the per-platform behaviors to web content. Under Windows, for example, there are four main complications for content authors:

1. Some user agents report keydown/keyup events with KeyboardEvent.key = "Alt" rather than "AltGraph".  Since the meaning of the right-hand Alt key depends on the keyboard layout in effect, this may cause sites with specialist keyboard handling to mis-interpret AltGraph as Alt.

2. All user agents tested (Chrome, Firefox, Edge) report AltGraph-modified keydown/keyup events with the Control and Alt modifiers also set. Although this accurately reflects how Windows represents AltGraph in input events, it creates confusion for content which associates special meanings with specific Control+<character> key combinations, if <character> is reached via AltGraph under the current layout.

3. Some user agents report the AltGraph modifier on events whenever both Control and Alt are active, even under layouts which do not use AltGraph at all. 

4. Some user agents generate keydown/keyup events with a KeyboardEvent.key value which does not represent the character actually generated by an AltGraph+<key> sequence.

5. All user agents tested (Chrome, Firefox, Edge) directly reflect the underlying platform key event sequence for AltGraph press/release, generating keydown with code=ControlLeft, keydown code=AltRight rather than a single keydown code=AltRight event.

We should at least provide an informative section in the specification to illustrate the issues that content authors must allow for, and ideally provide a normative specification for the expected behavior user agents should arrange to provide, where feasible.

+@garykac

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/147

Received on Thursday, 29 June 2017 23:54:52 UTC