Changeset 109128 in webkit


Ignore:
Timestamp:
Feb 28, 2012 11:32:37 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[chromium] Set nativeKeyCode to include Windows scan code
https://bugs.webkit.org/show_bug.cgi?id=79289

Patch by Gary Kacmarcik <garykac@chromium.org> on 2012-02-28
Reviewed by Ryosuke Niwa.

Set the key event's nativeKeyCode on Windows Chromium so that it
actually includes the native scancode and other context bits.
Currently on Windows, the nativeKeyCode is set to be the same value as
the windowsKeyCode, which is redundant.

The actual native key information is required so that components (like
plugins) can reconstruct the original key event. The value stored in
the windowsKeyCode is a Windows virtual key code which does not provide
sufficient info to disambiguate the actual key being pressed (for
example, it cannot distinguish between the left and right shift keys).

All platforms except Windows currently send native key event info, so
this change will bring Windows in line with other platforms.

This change is part of our effort to send enhanced keycode information
to Pepper plugins in Chromium.

  • src/win/WebInputEventFactory.cpp:

(WebKit::WebInputEventFactory::keyboardEvent):

Location:
trunk/Source/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r109119 r109128  
     12012-02-28  Gary Kacmarcik  <garykac@chromium.org>
     2
     3        [chromium] Set nativeKeyCode to include Windows scan code
     4        https://bugs.webkit.org/show_bug.cgi?id=79289
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Set the key event's nativeKeyCode on Windows Chromium so that it
     9        actually includes the native scancode and other context bits.
     10        Currently on Windows, the nativeKeyCode is set to be the same value as
     11        the windowsKeyCode, which is redundant.
     12
     13        The actual native key information is required so that components (like
     14        plugins) can reconstruct the original key event. The value stored in
     15        the windowsKeyCode is a Windows virtual key code which does not provide
     16        sufficient info to disambiguate the actual key being pressed (for
     17        example, it cannot distinguish between the left and right shift keys).
     18
     19        All platforms except Windows currently send native key event info, so
     20        this change will bring Windows in line with other platforms.
     21
     22        This change is part of our effort to send enhanced keycode information
     23        to Pepper plugins in Chromium.
     24
     25        * src/win/WebInputEventFactory.cpp:
     26        (WebKit::WebInputEventFactory::keyboardEvent):
     27
    1282012-02-28  Adam Klein  <adamk@chromium.org>
    229
  • trunk/Source/WebKit/chromium/src/win/WebInputEventFactory.cpp

    r95901 r109128  
    108108    result.timeStampSeconds = GetMessageTime() / 1000.0;
    109109
    110     result.windowsKeyCode = result.nativeKeyCode = static_cast<int>(wparam);
     110    result.windowsKeyCode = static_cast<int>(wparam);
     111    // Record the scan code (along with other context bits) for this key event.
     112    result.nativeKeyCode = static_cast<int>(lparam);
    111113
    112114    switch (message) {
Note: See TracChangeset for help on using the changeset viewer.