Bug 162861 - KeyboardEvent.getModifierState() should support "CapsLock" modifier
Summary: KeyboardEvent.getModifierState() should support "CapsLock" modifier
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://w3c.github.io/uievents/#dom-k...
Keywords: WebExposed
Depends on: 162855
Blocks: 162852
  Show dependency treegraph
 
Reported: 2016-10-02 15:15 PDT by Chris Dumez
Modified: 2016-10-05 14:15 PDT (History)
6 users (show)

See Also:


Attachments
Patch (26.81 KB, patch)
2016-10-05 12:00 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (26.88 KB, patch)
2016-10-05 12:03 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (28.12 KB, patch)
2016-10-05 12:42 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (28.12 KB, patch)
2016-10-05 13:08 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-10-02 15:15:35 PDT
getModifierState() should support for modifiers:
- https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate

In particular, we are missing the following ones: CapsLock, Fn, FnLock, Hyper, NumLock, Super, ScrollLock, Symbol, SymbolLock.
Comment 1 Chris Dumez 2016-10-04 09:06:33 PDT
The only one that is missing and that seems to make sense on Mac is capsLock.
Comment 2 Chris Dumez 2016-10-05 12:00:31 PDT
Created attachment 290734 [details]
Patch
Comment 3 Chris Dumez 2016-10-05 12:03:49 PDT
Created attachment 290735 [details]
Patch
Comment 4 Darin Adler 2016-10-05 12:22:09 PDT
Why doesn’t Fn make sense on Mac?
Comment 5 Darin Adler 2016-10-05 12:24:28 PDT
A good test case with Fn might be the return key with the "Fn" modifier down.
Comment 6 Chris Dumez 2016-10-05 12:25:06 PDT
(In reply to comment #4)
> Why doesn’t Fn make sense on Mac?

As far as I can tell, this is a hardware key, it does not generate an NSEvent.

Note that there is no ModifierFlag for Fn key on NSEvent:
- https://developer.apple.com/reference/appkit/nsevent/modifier_flags
Comment 7 Chris Dumez 2016-10-05 12:42:40 PDT
Created attachment 290741 [details]
Patch
Comment 8 Chris Dumez 2016-10-05 13:08:20 PDT
Created attachment 290743 [details]
Patch
Comment 9 WebKit Commit Bot 2016-10-05 14:15:20 PDT
Comment on attachment 290743 [details]
Patch

Clearing flags on attachment: 290743

Committed r206828: <http://trac.webkit.org/changeset/206828>
Comment 10 WebKit Commit Bot 2016-10-05 14:15:26 PDT
All reviewed patches have been landed.  Closing bug.