`KeyboardEvent.key` not capitalised when holding `Meta` and `Shift` on Mac OS X

Viewed 115

On Mac OS X, in both Chrome and Firefox, when the Command (i.e. Meta) key is held, the Shift key does not seem to affect capitalisation of the KeyboardEvent.key property. This can be tested by logging event.key in a keydown event:

document.addEventListener("keydown", event => console.log(event.key));

Holding Command-Shift-Z produces "z". Holding other modifiers, like Control-Shift-Z produce "Z" as expected. In other operating systems, this does not seem to occur: holding Shift will always make a letter capitalised.

Is this expected behaviour? If is, what's the reason behind it? I can't find any mention of it in the spec. If this isn't expected, what might be causing this behaviour?

0 Answers
Related