Bug 99411 - Incorrect keyIdentifier values are set for numeric keypad keys
Summary: Incorrect keyIdentifier values are set for numeric keypad keys
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Windows 7
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-15 20:31 PDT by Yasuhiro Matsuda
Modified: 2019-02-06 09:18 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.80 KB, patch)
2012-10-16 13:42 PDT, Yasuhiro Matsuda
no flags Details | Formatted Diff | Diff
Patch (2.14 KB, patch)
2012-10-17 11:39 PDT, Yasuhiro Matsuda
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yasuhiro Matsuda 2012-10-15 20:31:54 PDT
(Copied from http://code.google.com/p/chromium/issues/detail?id=155654)

Steps to reproduce:

1) Create an HTML file with the following content:

  <html>                                                                   
    <head>                                                                 
      <script type="text/javascript">                                      
        window.onkeydown = function(e) { console.log(e.keyIdentifier); };     
      </script>                                                               
    </head>                                                                   
  </html>                                                                     

2) Open this file in a Chrome browser window on a non-ChromeOS system, and open the console for that window.

3) Attach a keyboard that has a separate numeric keypad to the computer and press the "1" key on the main part of the keyboard and then the "1" key on the numeric keypad. Note the values listed in the console for each of these key presses.

4) Repeat #2 and #3 with a ChromeOS device.

Expected output:

- U+0031, U+0031, U+0031, U+0031

Actual output:

- U+0031, U+0031, U+0031, U+0041

Reproducibility:

- 100% Reproducible.

Impact:

- Web applications that depend on keyIdentifier to identify keys won't work with numeric keypads.

Additional information:

- "U+0031" is the keyIdentifier for keys that have a "1" glyph. "U+0041" is the keyIdentifier reserved for keys that have an "A" glyph and should not be returned for the numeric keypad "1" (http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/keyset.html)
Comment 1 Alexey Proskuryakov 2012-10-16 10:31:45 PDT
See also: bug 99188.
Comment 2 Yasuhiro Matsuda 2012-10-16 13:42:53 PDT
Created attachment 169014 [details]
Patch
Comment 3 Alexey Proskuryakov 2012-10-16 14:28:37 PDT
Comment on attachment 169014 [details]
Patch

Why is this table chromium specific? This just looks like cross-port platform code.
Comment 4 Yasuhiro Matsuda 2012-10-17 11:39:10 PDT
Created attachment 169226 [details]
Patch
Comment 5 Yasuhiro Matsuda 2012-10-17 12:00:46 PDT
(In reply to comment #3)
> (From update of attachment 169014 [details])
> Why is this table chromium specific? This just looks like cross-port platform code.

I'm not sure the exact reason, but keyIdentifier is set from platform dependent key codes per platform. This is a table for VKEY_* (not VK_*), which is chromium specific key code.
(I updated the patch by adding more numpad keys in the new Patch.)
Comment 6 Darin Adler 2013-04-08 10:36:00 PDT
Comment on attachment 169226 [details]
Patch

Chromium-specific patch. Clearing review flags.
Comment 7 Darin Adler 2013-04-08 10:39:23 PDT
Chromium-specific. Closing.
Comment 8 Lucas Forschler 2019-02-06 09:18:33 PST
Mass move bugs into the DOM component.