[w3c/uievents] Clarify `keypress` event handling for keys that map to non-BMP Unicode symbols (Issue #346)

See https://github.com/w3c/webdriver/issues/1741: browsers don’t agree on `keypress` events for keys that map to non-BMP Unicode symbols (i.e. code points beyond U+FFFF).

You can reproduce this on https://w3c.github.io/uievents/tools/key-event-viewer.html using a custom keyboard layout. I’m using https://github.com/mathiasbynens/custom.keylayout/tree/main/qwerty which lets me press a key to type `𝌆` (U+1D306), which consists of the surrogate halves U+D834 U+DF06.

- In Safari, a single `keypress` event is emitted, with `charCode`/`keyCode`/`which` set to the full Unicode code point `0x1D306`. (This is the behavior I’d expect as a user.)
- In Firefox, two `keypress` events are emitted, one for each surrogate half (`0xD834` and `0xDF06`).
- In Chrome, no `keypress` event is emitted.


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

Message ID: <w3c/uievents/issues/346@github.com>

Received on Wednesday, 24 May 2023 12:14:32 UTC