Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add specification for AltGraph key & modifier behaviour #147

@drwez

Description

@drwez

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+ key combinations, if 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+ 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions