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

Issue 2580483002: [Linux] Ctrl should be considered as system modifier and not producing characters (Closed)

Created:
4 years ago by chongz
Modified:
3 years, 10 months ago
Reviewers:
msw, dtapuska, kpschoedel
CC:
chromium-reviews, tdresser+watch_chromium.org, afakhry, oshima, Avi (use Gerrit), sadrul
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Linux] Ctrl should be considered as system modifier and not producing characters |KeyEvent::GetCharacter()| returns the character value of the DomKey, which is not necessarily the character to be produced by the event. e.g. "Ctrl+t" doesn't produce a printable character, but the DomKey is "t". |Textfield| (and other components) relies on the system modifier check to detect whether they should put a character, and this CL adds Ctrl key as an additional filter. This is based on the fact that XKB doesn't have a combination with Ctrl that maps to a printable character. For Windows: 1. We can't do it because Ctrl+Shift+2 should insert ZWNJ with Persian Keyboard 2. It's currently not breaking because Windows native 'keypress' has different |key| value < 0x20 For Mac: 1. Mac doesn't have this issue and it seems to be using a different approach in |RenderWidgetHostViewMac::insertText| Related issue https://crbug.com/633838 BUG=673302 Review-Url: https://codereview.chromium.org/2580483002 Cr-Commit-Position: refs/heads/master@{#450387} Committed: https://chromium.googlesource.com/chromium/src/+/4127317ca378c1cd8be4dd09428f0dd232888f68

Patch Set 1 #

Patch Set 2 : dtapuska's review: Add IsControlKeyModifier() instead of changing system modifier #

Total comments: 18

Patch Set 3 : msw's comments #

Total comments: 8

Patch Set 4 : msw's comments 2 #

Total comments: 2

Patch Set 5 : msw's comment 3: Add comments for ctrl modifier on Linux #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -8 lines) Patch
M ui/views/controls/textfield/textfield.cc View 1 2 3 4 2 chunks +18 lines, -5 lines 0 comments Download
M ui/views/controls/textfield/textfield_unittest.cc View 1 2 3 2 chunks +26 lines, -3 lines 0 comments Download

Messages

Total messages: 60 (42 generated)
chongz
dtapuska@ PTAL, thanks!
4 years ago (2016-12-19 20:46:56 UTC) #19
dtapuska
On 2016/12/19 20:46:56, chongz wrote: > dtapuska@ PTAL, thanks! I'm not sure if this is ...
4 years ago (2016-12-19 21:38:01 UTC) #20
chongz
> I'm not sure if this is right... Typically I think the system modifier on ...
4 years ago (2016-12-19 21:59:44 UTC) #24
sadrul
+kpschoedel@
4 years ago (2016-12-20 17:43:41 UTC) #28
chongz
On 2016/12/20 17:43:41, sadrul wrote: > +kpschoedel@ kpschoedel@ Please take a look, thanks!
3 years, 11 months ago (2017-01-10 15:48:13 UTC) #29
kpschoedel
LGTM, but I'm not especially familiar with this code.
3 years, 11 months ago (2017-01-10 18:32:36 UTC) #30
chongz
pkasting@ PTAL at "ui/views/controls/textfield/textfield.cc", thanks!
3 years, 11 months ago (2017-01-10 18:47:10 UTC) #32
Peter Kasting
It's not obvious to me why this change is X11-specific. The CL description justifies this ...
3 years, 11 months ago (2017-01-10 22:56:12 UTC) #33
sadrul
--> msw@ for owner
3 years, 11 months ago (2017-01-11 02:47:56 UTC) #35
msw
I have more questions than helpful advice; sorry. +CC afakhry, oshima, and avi (per related ...
3 years, 11 months ago (2017-01-11 19:36:37 UTC) #36
chongz
msw@ Thanks for the review and sorry for the delay. I think we can extend ...
3 years, 11 months ago (2017-01-13 16:08:38 UTC) #44
msw
https://codereview.chromium.org/2580483002/diff/60001/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2580483002/diff/60001/ui/views/controls/textfield/textfield.cc#newcode219 ui/views/controls/textfield/textfield.cc:219: #if defined(USE_X11) On 2017/01/13 16:08:38, chongz wrote: > On ...
3 years, 11 months ago (2017-01-13 18:15:51 UTC) #45
kpschoedel
https://codereview.chromium.org/2580483002/diff/60001/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2580483002/diff/60001/ui/views/controls/textfield/textfield.cc#newcode219 ui/views/controls/textfield/textfield.cc:219: #if defined(USE_X11) To make a long story short… Personal ...
3 years, 11 months ago (2017-01-13 20:39:05 UTC) #46
chongz
msw@ just an update: Are you convinced by kpschoedel@'s comments? https://codereview.chromium.org/2580483002/diff/60001/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/2580483002/diff/60001/ui/views/controls/textfield/textfield_unittest.cc#newcode766 ...
3 years, 10 months ago (2017-02-13 16:23:47 UTC) #48
msw
lgtm with a nit; +CC sadrul for event code sanity checking https://codereview.chromium.org/2580483002/diff/100001/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): ...
3 years, 10 months ago (2017-02-13 18:05:42 UTC) #53
chongz
https://codereview.chromium.org/2580483002/diff/100001/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2580483002/diff/100001/ui/views/controls/textfield/textfield.cc#newcode219 ui/views/controls/textfield/textfield.cc:219: bool IsControlKeyModifier(int flags) { On 2017/02/13 18:05:42, msw wrote: ...
3 years, 10 months ago (2017-02-13 19:08:59 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2580483002/120001
3 years, 10 months ago (2017-02-14 16:01:03 UTC) #57
commit-bot: I haz the power
3 years, 10 months ago (2017-02-14 17:07:14 UTC) #60
Message was sent while issue was closed.
Committed patchset #5 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/4127317ca378c1cd8be4dd09428f...

Powered by Google App Engine
This is Rietveld 408576698