[Webkit-unassigned] [Bug 174782] New: KeyboardEvent#key reports lowecase letter with Shift+Cmd
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jul 24 03:26:54 PDT 2017
https://bugs.webkit.org/show_bug.cgi?id=174782
Bug ID: 174782
Summary: KeyboardEvent#key reports lowecase letter with
Shift+Cmd
Product: WebKit
Version: Safari 10
Hardware: Macintosh
OS: macOS 10.12.4
Status: NEW
Severity: Normal
Priority: P2
Component: HTML Events
Assignee: webkit-unassigned at lists.webkit.org
Reporter: keithamus at github.com
KeyboardEvent#key is supposed to report the key character that was pressed. The spec - specifically 5.3.2 "modifier keys" (https://www.w3.org/TR/uievents/#keys-modifiers) shows that if the `shiftKey` is true, then the `event.key` value should be in its "shifted state" - this includes when pressed in combination with other keys - for example `metaKey` (in Example 24 (https://www.w3.org/TR/uievents/#example-aa6d4cea) they use `ctrlKey` and `shiftKey`).
Safari misreports this, contrary to other browsers. An example:
```
// Pressing Shift+P results in:
event.shiftKey && event.key === 'P'
// Pressing Ctrl+Shift+P results in:
event.ctrlKey && event.shiftKey && event.key === 'P'
// Pressing Cmd+Shift+P results in:
event.metaKey && event.shiftKey && event.key === 'p' // lowercase, incorrect
```
To compare Firefox, Chrome, report the following:
```
// Pressing Shift+P results in:
event.shiftKey && event.key === 'P'
// Pressing Ctrl+Shift+P results in:
event.ctrlKey && event.shiftKey && event.key === 'P'
// Pressing Cmd+Shift+P results in:
event.metaKey && event.shiftKey && event.key === 'P' // uppercase, correct
```
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170724/aced9194/attachment-0001.html>
More information about the webkit-unassigned
mailing list