summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authordtapuska <dtapuska@chromium.org>2015-10-23 08:59:23 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-23 16:00:18 +0000
commit681454598489257cab491436a8ec6198c6c1e9be (patch)
treef7fd651b0114a165e1f58b8a5fc311e2033f731c /ui
parent36b19501d8bcf869a36f3c8e983ed1ec477f3529 (diff)
downloadchromium_src-681454598489257cab491436a8ec6198c6c1e9be.zip
chromium_src-681454598489257cab491436a8ec6198c6c1e9be.tar.gz
chromium_src-681454598489257cab491436a8ec6198c6c1e9be.tar.bz2
AltGr keys were not working.
Introduced by https://codereview.chromium.org/1409823002 the masking of control characters caused a regression on Windows. Windows maps AltGr to Ctrl-Alt; so natively the Ctrl-Alt are both set causing the character to be masked out when a AltGr key was entered. Ensure that AltGr is not down. BUG=529883,546464 Review URL: https://codereview.chromium.org/1414853004 Cr-Commit-Position: refs/heads/master@{#355794}
Diffstat (limited to 'ui')
-rw-r--r--ui/events/event.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/events/event.cc b/ui/events/event.cc
index ff725aa..71e2cd3 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -812,7 +812,9 @@ base::char16 KeyEvent::GetCharacter() const {
DomKey::Base utf32_character = key_.ToCharacter();
base::char16 ucs2_character = static_cast<base::char16>(utf32_character);
DCHECK(static_cast<DomKey::Base>(ucs2_character) == utf32_character);
- if (flags() & EF_CONTROL_DOWN) {
+ // Check if the control character is down. Note that ALTGR is represented
+ // on Windows as CTRL|ALT, so we need to make sure that is not set.
+ if ((flags() & (EF_ALTGR_DOWN | EF_CONTROL_DOWN)) == EF_CONTROL_DOWN) {
// For a control character, key_ contains the corresponding printable
// character. To preserve existing behaviour for now, return the control
// character here; this will likely change -- see e.g. crbug.com/471488.