RESOLVED FIXED94142
Added modifiers to distinguish between left/right Shift/Ctrl/Alt
https://bugs.webkit.org/show_bug.cgi?id=94142
Summary Added modifiers to distinguish between left/right Shift/Ctrl/Alt
Raymes Khoury
Reported 2012-08-15 13:38:29 PDT
Added modifiers to distinguish between left/right Shift/Ctrl/Alt
Attachments
Patch (19.24 KB, patch)
2012-08-29 13:22 PDT, Raymes Khoury
no flags
Patch (18.65 KB, patch)
2012-08-29 13:50 PDT, Raymes Khoury
no flags
Patch (18.66 KB, patch)
2012-08-30 09:31 PDT, Raymes Khoury
no flags
Patch (18.91 KB, patch)
2012-09-05 10:42 PDT, Raymes Khoury
no flags
Patch (18.93 KB, patch)
2012-09-05 14:43 PDT, Raymes Khoury
no flags
Alexey Proskuryakov
Comment 1 2012-08-15 16:00:40 PDT
Could you please provide more details about this issue? Specifically, I'm wondering if it has been already resolved in bug 86694.
Raymes Khoury
Comment 2 2012-08-16 10:23:52 PDT
Thanks for the link (I intended on uploading a patch with this but webkit-patch upload broke in the process). There are 2 problems with the existing behavior: 1) The Windows implementation of WebInputEventFactory never produces key events with e.g. VK_LSHIFT or VK_RSHIFT, only VK_SHIFT. 2) The more major problem here is that after these events round-trip through WebCore and get converted back to WebKeyboardEvents, the location information is lost (see Source/WebCore/dom/KeyboardEvent.cpp:keyCode() which calls windowsVirtualKeyCode()). This means that we don't have access to the key location in plugins, for example. Furthermore, I would be concerned about converting back to the L/R versions of the keycodes because existing code relies on checking for the non-locational version of the keycode (e.g. VK_SHIFT). I believe that the L/R version of the keycodes should never be returned from event factories (after all they are never returned by the Windows API). We should have a separate location modifier/field in WebKeyboardEvent for specifying the location of the keypress (as in KeyboardEvent). I'll work up a patch to this effect.
Raymes Khoury
Comment 3 2012-08-29 13:22:47 PDT
WebKit Review Bot
Comment 4 2012-08-29 13:29:48 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
WebKit Review Bot
Comment 5 2012-08-29 13:30:06 PDT
Attachment 161297 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/chromium/ChangeLog', u'Sourc..." exit_code: 1 Source/WebKit/chromium/tests/WebInputEventConversionTest.cpp:34: Alphabetical sorting problem. [build/include_order] [4] Source/WebKit/chromium/tests/WebInputEventConversionTest.cpp:36: Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] Total errors found: 2 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Raymes Khoury
Comment 6 2012-08-29 13:50:03 PDT
WebKit Review Bot
Comment 7 2012-08-29 14:26:42 PDT
Attachment 161305 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/chromium/ChangeLog', u'Sourc..." exit_code: 1 Source/WebKit/chromium/tests/WebInputEventConversionTest.cpp:34: Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] Total errors found: 1 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Peter Beverloo (cr-android ews)
Comment 8 2012-08-29 15:49:28 PDT
Comment on attachment 161305 [details] Patch Attachment 161305 [details] did not pass cr-android-ews (chromium-android): Output: http://queues.webkit.org/results/13687395
WebKit Review Bot
Comment 9 2012-08-29 19:44:18 PDT
Comment on attachment 161305 [details] Patch Attachment 161305 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13687499
Raymes Khoury
Comment 10 2012-08-30 09:31:29 PDT
Raymes Khoury
Comment 11 2012-09-03 21:36:04 PDT
Ping for review
Tony Chang
Comment 12 2012-09-04 16:21:16 PDT
Comment on attachment 161493 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=161493&action=review > Source/WebKit/chromium/ChangeLog:20 > + modifiers. Since this only changes internal representation, no new > + tests are added. Can you add a 'why' to the ChangeLog entry? Saying that you need this for plugins would be sufficient. > Source/WebKit/chromium/src/win/WebInputEventFactory.cpp:51 > + if (wparam == VK_SHIFT) { > + if (GetKeyState(VK_LSHIFT)) > + modifier = WebInputEvent::IsLeft; > + else if (GetKeyState(VK_RSHIFT)) Should we move all of this into the switch below? > Source/WebKit/chromium/src/win/WebInputEventFactory.cpp:104 > + ASSERT(modifier Is this assert correct? Can't modifier be 0?
Raymes Khoury
Comment 13 2012-09-05 10:42:44 PDT
Raymes Khoury
Comment 14 2012-09-05 10:45:20 PDT
Comment on attachment 161493 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=161493&action=review >> Source/WebKit/chromium/ChangeLog:20 >> + tests are added. > > Can you add a 'why' to the ChangeLog entry? Saying that you need this for plugins would be sufficient. Done. >> Source/WebKit/chromium/src/win/WebInputEventFactory.cpp:51 >> + else if (GetKeyState(VK_RSHIFT)) > > Should we move all of this into the switch below? Done. >> Source/WebKit/chromium/src/win/WebInputEventFactory.cpp:104 >> + ASSERT(modifier > > Is this assert correct? Can't modifier be 0? Yes, sorry this was introduced while fixing style.
Tony Chang
Comment 15 2012-09-05 12:05:50 PDT
Comment on attachment 162280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=162280&action=review > Source/WebKit/chromium/src/win/WebInputEventFactory.cpp:86 > + if (GetKeyState(VK_LSHIFT) & 0x8000) Nit: I would probably make a function IsHighBitSet. It would be a little easier to read. > Source/WebKit/chromium/src/win/WebInputEventFactory.cpp:111 > + ASSERT(modifier == 0 Nit: WebKit style is !modifier rather than comparing to 0.
Raymes Khoury
Comment 16 2012-09-05 14:43:56 PDT
Raymes Khoury
Comment 17 2012-09-05 14:45:12 PDT
Comment on attachment 162280 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=162280&action=review >> Source/WebKit/chromium/src/win/WebInputEventFactory.cpp:86 >> + if (GetKeyState(VK_LSHIFT) & 0x8000) > > Nit: I would probably make a function IsHighBitSet. It would be a little easier to read. Changed to isKeyDown >> Source/WebKit/chromium/src/win/WebInputEventFactory.cpp:111 >> + ASSERT(modifier == 0 > > Nit: WebKit style is !modifier rather than comparing to 0. Done.
Raymes Khoury
Comment 18 2012-09-05 15:46:09 PDT
*** Bug 93132 has been marked as a duplicate of this bug. ***
WebKit Review Bot
Comment 19 2012-09-06 02:18:55 PDT
Comment on attachment 162340 [details] Patch Clearing flags on attachment: 162340 Committed r127711: <http://trac.webkit.org/changeset/127711>
WebKit Review Bot
Comment 20 2012-09-06 02:18:59 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.