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

Issue 1776673007: [Windows] Produce correct DomKey for NumPad when combined with Shift/NumLock (Closed)

Created:
4 years, 9 months ago by chongz
Modified:
4 years, 9 months ago
CC:
chromium-reviews, 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

[Windows] Produce correct DomKey for NumPad when combined with Shift/NumLock The expected behavior for Shift, NumLock and NumPad should be (use NumPad4 as an example): NumPad4 => "ArrowLeft" Shift+NumPad4 => "ArrowLeft" NumLock+NumPad4 => "4" Shift+NumLock+NumPad4 => "ArrowLeft" However there is an implementation problem due to Windows' fake-shift-release behaviour, which means we cannot use DomCode+Flags to uniquely determine DomKey. (Cannot distinguish NumLock+NumPad4 and Shift+NumLock+NumPad4) The alternative approach is to use KeyboardCode instead DomCode because Shift modifier is not reliable when NumLock is on. /* Example for Windows' fake-shift-release behaviour: With NumLock on, 1. press Shift 2. press NumPad4 3. release NumPad4 4. release Shift will produce: ----- EventType DomCode Shift NumLock ----- keydown ShiftLeft true true keyup ShiftLeft false true keydown Numpad4 false true <- Shift is false?! keyup NumPad4 false true keydown ShiftLeft true true keyup ShiftLeft false true */ BUG=594552 Committed: https://crrev.com/866b9e1c3542ed922285cf06b7d60f89758b20b5 Cr-Commit-Position: refs/heads/master@{#382574}

Patch Set 1 #

Total comments: 7

Patch Set 2 : wez's review #

Total comments: 21

Patch Set 3 : wez's review 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+202 lines, -59 lines) Patch
M ui/events/BUILD.gn View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M ui/events/event.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/events/events.gyp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M ui/events/keycodes/platform_key_map_win.h View 1 2 2 chunks +17 lines, -12 lines 0 comments Download
M ui/events/keycodes/platform_key_map_win.cc View 1 2 5 chunks +65 lines, -3 lines 0 comments Download
M ui/events/keycodes/platform_key_map_win_unittest.cc View 1 2 6 chunks +115 lines, -39 lines 0 comments Download

Messages

Total messages: 33 (14 generated)
chongz
PTAL, thanks! https://codereview.chromium.org/1776673007/diff/1/ui/events/keycodes/platform_key_map_win.h File ui/events/keycodes/platform_key_map_win.h (right): https://codereview.chromium.org/1776673007/diff/1/ui/events/keycodes/platform_key_map_win.h#newcode40 ui/events/keycodes/platform_key_map_win.h:40: int ui_event_flags); This interface looks ugly but ...
4 years, 9 months ago (2016-03-10 00:59:10 UTC) #2
dtapuska
https://codereview.chromium.org/1776673007/diff/1/ui/events/event.cc File ui/events/event.cc (right): https://codereview.chromium.org/1776673007/diff/1/ui/events/event.cc#newcode868 ui/events/event.cc:868: key_ = PlatformKeyMap::DomCodeAndFlagsToDomKeyStatic(code_, key_code_, This is certainly odd that ...
4 years, 9 months ago (2016-03-10 20:51:44 UTC) #3
chongz
Hi Wez, can you take a look at this CL please? Thanks! https://codereview.chromium.org/1776673007/diff/1/ui/events/keycodes/platform_key_map_win.cc File ui/events/keycodes/platform_key_map_win.cc ...
4 years, 9 months ago (2016-03-10 21:03:32 UTC) #5
Wez
Are you sure the BUG= line is correct? That bug describes the DomKey being wrong ...
4 years, 9 months ago (2016-03-11 21:40:12 UTC) #6
chongz
On 2016/03/11 21:40:12, Wez wrote: > Are you sure the BUG= line is correct? That ...
4 years, 9 months ago (2016-03-11 22:18:28 UTC) #7
Wez
On 2016/03/11 22:18:28, chongz wrote: > On 2016/03/11 21:40:12, Wez wrote: > > Are you ...
4 years, 9 months ago (2016-03-11 22:23:51 UTC) #8
chongz
On 2016/03/11 22:23:51, Wez wrote: > On 2016/03/11 22:18:28, chongz wrote: > > On 2016/03/11 ...
4 years, 9 months ago (2016-03-14 14:42:17 UTC) #12
Wez
https://codereview.chromium.org/1776673007/diff/1/ui/events/event.cc File ui/events/event.cc (right): https://codereview.chromium.org/1776673007/diff/1/ui/events/event.cc#newcode868 ui/events/event.cc:868: key_ = PlatformKeyMap::DomCodeAndFlagsToDomKeyStatic(code_, key_code_, On 2016/03/10 20:51:44, dtapuska wrote: ...
4 years, 9 months ago (2016-03-16 21:03:07 UTC) #13
chongz
Hi wez, I've updated CL as per your comments, PTAL, thanks! https://codereview.chromium.org/1776673007/diff/40001/ui/events/keycodes/platform_key_map_win.cc File ui/events/keycodes/platform_key_map_win.cc (right): ...
4 years, 9 months ago (2016-03-17 21:30:32 UTC) #15
Wez
https://codereview.chromium.org/1776673007/diff/40001/ui/events/event.cc File ui/events/event.cc (right): https://codereview.chromium.org/1776673007/diff/40001/ui/events/event.cc#newcode868 ui/events/event.cc:868: key_ = PlatformKeyMap::DomKeyFromNativeStatic(native_event); nit: It'd be more in-keeping w/ ...
4 years, 9 months ago (2016-03-18 22:50:39 UTC) #16
chongz
Hi wez, I've updated CL but was having difficulty apply all the comments, PTAL, thanks! ...
4 years, 9 months ago (2016-03-21 20:07:29 UTC) #19
Wez
lgtm
4 years, 9 months ago (2016-03-21 23:56:15 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1776673007/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1776673007/100001
4 years, 9 months ago (2016-03-21 23:56:38 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/159453)
4 years, 9 months ago (2016-03-22 00:08:27 UTC) #24
chongz
Hi avi, can you take a look at "ui/events/event.cc" code path please? Thanks!
4 years, 9 months ago (2016-03-22 04:40:21 UTC) #26
Avi (use Gerrit)
lgtm stampity stamp
4 years, 9 months ago (2016-03-22 14:54:55 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1776673007/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1776673007/100001
4 years, 9 months ago (2016-03-22 14:56:22 UTC) #29
commit-bot: I haz the power
Committed patchset #3 (id:100001)
4 years, 9 months ago (2016-03-22 15:33:21 UTC) #31
commit-bot: I haz the power
4 years, 9 months ago (2016-03-22 15:34:51 UTC) #33
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/866b9e1c3542ed922285cf06b7d60f89758b20b5
Cr-Commit-Position: refs/heads/master@{#382574}

Powered by Google App Engine
This is Rietveld 408576698