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

Issue 1706683002: [Mac] Produce correct DomKey when Ctrl/Shift/Command is down (Closed)

Created:
4 years, 10 months ago by chongz
Modified:
4 years, 10 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, tdresser+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Mac] Produce correct DomKey when Ctrl/Shift/Command is down Assume the key combination does not produce a printable character when Ctrl/Command is down. Use UCKeyTranslate() to get fallback character without modifiers except Shift and Alt. After CL e.g. On US keyboard Ctrl+h == h ==> DomKey 'h' Ctrl+CapsLock+b == CapsLock+b ==> 'B' Ctrl+Alt+g == Alt+g ==> '∂' Ctrl+Alt+Shift+d == Alt+Shift+d ==> 'Î' French Keyboard Ctrl+Shift+2 == Shift+2 ==> '2' Ctrl+2 == 2 ==> 'é' This will match Chrome's behavior on other platforms and mostly match Firefox's behavior. (FF has some issue with Ctrl+2 on French keyboard) BUG=586571 Committed: https://crrev.com/ca9e1ec794ea4da8248fb40695d0a8b70f4e8085 Cr-Commit-Position: refs/heads/master@{#377346}

Patch Set 1 #

Patch Set 2 : Use std::iscntrl to check control characters instead of writing own method #

Total comments: 1

Patch Set 3 : Add test case for Ctrl+Shift+foo #

Total comments: 1

Patch Set 4 : Use Shift, Alt and CapsLock as fallback modifiers #

Total comments: 3

Patch Set 5 : Fix Ctrl/Ctrl+Shift to pass garykac's keyboard tester #

Total comments: 20

Patch Set 6 : tapted's review, add test Alt and Ctrl Alt #

Total comments: 5

Patch Set 7 : dtapuska and tdresser's review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+239 lines, -9 lines) Patch
M content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm View 1 2 3 4 5 6 2 chunks +159 lines, -1 line 0 comments Download
M ui/events/keycodes/keyboard_code_conversion_mac.mm View 1 2 3 4 5 6 5 chunks +80 lines, -8 lines 0 comments Download

Messages

Total messages: 32 (14 generated)
chongz
Hi dtapuska, can you take a look at the CL please? Thanks!
4 years, 10 months ago (2016-02-17 15:37:45 UTC) #2
dtapuska
https://codereview.chromium.org/1706683002/diff/20001/content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm File content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm (right): https://codereview.chromium.org/1706683002/diff/20001/content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm#newcode269 content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm:269: } table[] = {{kVK_ANSI_A, 'a', ui::DomKey::FromCharacter('a')}, We likely should ...
4 years, 10 months ago (2016-02-17 20:42:35 UTC) #3
chongz
Hi garykac, can you take a look at this CL please? Thanks! https://codereview.chromium.org/1706683002/diff/40001/ui/events/keycodes/keyboard_code_conversion_mac.mm File ui/events/keycodes/keyboard_code_conversion_mac.mm ...
4 years, 10 months ago (2016-02-17 22:54:05 UTC) #7
garykac
On 2016/02/17 22:54:05, chongz wrote: > Hi garykac, can you take a look at this ...
4 years, 10 months ago (2016-02-18 00:59:58 UTC) #8
chongz
Hi garykac, I've updated CL so it will use Shift, Alt and CapsLock as fallback ...
4 years, 10 months ago (2016-02-18 06:04:08 UTC) #9
garykac
On 2016/02/18 06:04:08, chongz wrote: > Hi garykac, I've updated CL so it will use ...
4 years, 10 months ago (2016-02-19 18:57:46 UTC) #11
chongz
Hi thakis, can you take a look at this CL please? I'm not sure if ...
4 years, 10 months ago (2016-02-22 20:17:18 UTC) #15
Nico
I haven't looked at the keyboard handling code in years. tapted, didn't you touch this ...
4 years, 10 months ago (2016-02-23 17:31:34 UTC) #17
tapted
On 2016/02/23 17:31:34, Nico wrote: > I haven't looked at the keyboard handling code in ...
4 years, 10 months ago (2016-02-23 23:55:53 UTC) #18
tapted
https://codereview.chromium.org/1706683002/diff/100001/ui/events/keycodes/keyboard_code_conversion_mac.mm File ui/events/keycodes/keyboard_code_conversion_mac.mm (right): https://codereview.chromium.org/1706683002/diff/100001/ui/events/keycodes/keyboard_code_conversion_mac.mm#newcode807 ui/events/keycodes/keyboard_code_conversion_mac.mm:807: if (dom_key_char < 0x80 && ([event modifierFlags] & kCtrlCmdKeyMask)) ...
4 years, 10 months ago (2016-02-24 00:05:51 UTC) #19
chongz
Thanks for the detailed review! I've updated CL as per your comments. Hi dtapuska@, can ...
4 years, 10 months ago (2016-02-24 15:12:30 UTC) #21
dtapuska
https://codereview.chromium.org/1706683002/diff/120001/ui/events/keycodes/keyboard_code_conversion_mac.mm File ui/events/keycodes/keyboard_code_conversion_mac.mm (right): https://codereview.chromium.org/1706683002/diff/120001/ui/events/keycodes/keyboard_code_conversion_mac.mm#newcode662 ui/events/keycodes/keyboard_code_conversion_mac.mm:662: UniChar unicode_string[255]; Why is this 255? when your max ...
4 years, 10 months ago (2016-02-24 17:07:47 UTC) #22
tdresser
Other than a couple periods (there's a few more missing in that file), this LGTM, ...
4 years, 10 months ago (2016-02-24 17:12:08 UTC) #23
chongz
Hi dtapuska, sorry that was a typo, I've updated CL, please take a look, thanks!
4 years, 10 months ago (2016-02-24 18:04:15 UTC) #24
dtapuska
On 2016/02/24 18:04:15, chongz wrote: > Hi dtapuska, sorry that was a typo, I've updated ...
4 years, 10 months ago (2016-02-24 18:36:36 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706683002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706683002/140001
4 years, 10 months ago (2016-02-24 18:52:02 UTC) #28
commit-bot: I haz the power
Committed patchset #7 (id:140001)
4 years, 10 months ago (2016-02-24 19:41:48 UTC) #30
commit-bot: I haz the power
4 years, 10 months ago (2016-02-24 19:43:05 UTC) #32
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/ca9e1ec794ea4da8248fb40695d0a8b70f4e8085
Cr-Commit-Position: refs/heads/master@{#377346}

Powered by Google App Engine
This is Rietveld 408576698