Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Issue 611993002: linux: Do not fallback to the hardware keycodes for modifers. (Closed)

Created:
6 years, 2 months ago by Yuki
Modified:
6 years, 2 months ago
Reviewers:
Shu Chen, Wez
CC:
chromium-reviews, tdresser+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

linux: Do not fallback to the hardware keycodes for modifiers. Previously Chrome would fall-back to deriving VKEY values directly from the hardware keycode if it was unable to derive a value from the X KeySym. While that is necessary for e.g. providing valid VKEYs for printable character keys under non-Latin keyboard layouts (such as Hebrew or Arabic), it had the side-effect of causing KeySyms with no VKEY equivalent to be mapped to incorrect meanings. In issue 402320, for example, the ISO_Level3_Latch KeySym has no VKEY equivalent, so should result in VKEY_UNKNOWN, but was instead having an incorrect VKEY derived from the X11 keycode instead. Note that there is no clear reason why we don't allow the modifier keys to fall back to the hardware keycode while we allow the printable character keys to fall back. It's just close to what users expect. There could be a problem if a keyboard layout had a composition character on Control + Ч (which falls back to VKEY_X). Users cannot type that composition character because a Cut accelerator triggers instead. This approach is a heuristic designed to approximate the VKEY values that a Windows system would generate, to ensure compatibility. BUG=402320 TEST=Done manually (assigning ISO_Level3_Latch to key code 108). Committed: https://crrev.com/83c2b41f1a06ca226a05edf0602d5c6efea32a8b Cr-Commit-Position: refs/heads/master@{#298478}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Fixed CrOS build. #

Patch Set 4 : Fallback to hardware keycodes only when Control is pressed. #

Patch Set 5 : Very small refactoring without any fix. #

Patch Set 6 : Added an actual fix. #

Patch Set 7 : Fix builds. #

Patch Set 8 : Synced. #

Patch Set 9 : Fix builds. #

Total comments: 6

Patch Set 10 : Addressed wez's review comments. #

Total comments: 6

Patch Set 11 : Addressed wez's review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
M ui/events/keycodes/keyboard_code_conversion_x.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 22 (4 generated)
Yuki
Could you guys review this CL? (wez@ as an owner and shuchen@ just fyi.) This ...
6 years, 2 months ago (2014-09-29 09:49:31 UTC) #2
Wez
If we're making this change for Linux then yes, it seems we should make it ...
6 years, 2 months ago (2014-09-29 16:21:53 UTC) #3
Shu Chen
It's me. My cl https://codereview.chromium.org/357613002/ changed the original behaviors. Originally the code looks like: KeyboardCode ...
6 years, 2 months ago (2014-09-30 01:28:06 UTC) #4
Yuki
> On 2014/09/29 16:21:53, Wez wrote: > > If we're making this change for Linux ...
6 years, 2 months ago (2014-09-30 06:40:43 UTC) #5
Shu Chen
lgtm
6 years, 2 months ago (2014-09-30 07:23:51 UTC) #7
Yuki
wez@, could you take another look?
6 years, 2 months ago (2014-10-01 07:09:48 UTC) #8
Yuki
I had some discussions with wez@ and found that we need to emit JS key ...
6 years, 2 months ago (2014-10-02 14:44:41 UTC) #9
Shu Chen
I have no problem with the solution. lgtm.
6 years, 2 months ago (2014-10-02 16:01:07 UTC) #10
Wez
The CL description doesn't make clear why the solution is not simply to handle ISO_Level3_Latch. ...
6 years, 2 months ago (2014-10-03 12:38:44 UTC) #11
Yuki
Thanks for the review. I revised the code. Could you review again? > The CL ...
6 years, 2 months ago (2014-10-03 14:33:47 UTC) #13
Wez
Re the CL description: -- linux: Do not fallback to the hardware keycodes for modifiers. ...
6 years, 2 months ago (2014-10-03 17:50:29 UTC) #14
Wez
https://codereview.chromium.org/611993002/diff/220001/ui/events/keycodes/keyboard_code_conversion_x.cc File ui/events/keycodes/keyboard_code_conversion_x.cc (right): https://codereview.chromium.org/611993002/diff/220001/ui/events/keycodes/keyboard_code_conversion_x.cc#newcode16 ui/events/keycodes/keyboard_code_conversion_x.cc:16: // Old versions of <X11/keysymdef.h> don't define XK_dead_greek. If ...
6 years, 2 months ago (2014-10-03 17:57:01 UTC) #15
Yuki
Thanks for a lot of comments. Now we need only a few lines of code. ...
6 years, 2 months ago (2014-10-06 07:50:18 UTC) #16
Yuki
For dead keys, I checked what keycodes are emitted on Windows, and it turned out ...
6 years, 2 months ago (2014-10-06 07:54:29 UTC) #17
Wez
LGTM once the CL description is trimmed down!
6 years, 2 months ago (2014-10-07 14:39:43 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/611993002/240001
6 years, 2 months ago (2014-10-07 14:47:38 UTC) #20
commit-bot: I haz the power
Committed patchset #11 (id:240001) as e8bab6cb2fc7694f1634b77129c7b35cfeac305b
6 years, 2 months ago (2014-10-07 14:56:39 UTC) #21
commit-bot: I haz the power
6 years, 2 months ago (2014-10-07 14:57:19 UTC) #22
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/83c2b41f1a06ca226a05edf0602d5c6efea32a8b
Cr-Commit-Position: refs/heads/master@{#298478}

Powered by Google App Engine
This is Rietveld 408576698