diff options
author | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 03:17:39 +0000 |
---|---|---|
committer | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 03:17:39 +0000 |
commit | aaf40ca9757a1c8baf4933c1ec598f52c9582fc7 (patch) | |
tree | d2d08785dd75fe76079d6f556206db8d2278a900 /ash/keyboard_overlay | |
parent | 22764755f06f11f7e01e659f33401b0a2056ab6d (diff) | |
download | chromium_src-aaf40ca9757a1c8baf4933c1ec598f52c9582fc7.zip chromium_src-aaf40ca9757a1c8baf4933c1ec598f52c9582fc7.tar.gz chromium_src-aaf40ca9757a1c8baf4933c1ec598f52c9582fc7.tar.bz2 |
Ignore the caps lock state for closing the keyboard overlay.
BUG=141215
TEST=Turn caps lock on, press Ctrl+Alt+/, press escape, and check the keyboard overlay is closed.
Review URL: https://chromiumcodereview.appspot.com/10826211
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/keyboard_overlay')
-rw-r--r-- | ash/keyboard_overlay/keyboard_overlay_view.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ash/keyboard_overlay/keyboard_overlay_view.cc b/ash/keyboard_overlay/keyboard_overlay_view.cc index 6545c0e..170cc28 100644 --- a/ash/keyboard_overlay/keyboard_overlay_view.cc +++ b/ash/keyboard_overlay/keyboard_overlay_view.cc @@ -24,7 +24,7 @@ const struct KeyEventData { ui::KeyboardCode key_code; int flags; } kCancelKeys[] = { - { ui::VKEY_ESCAPE, 0}, + { ui::VKEY_ESCAPE, ui::EF_NONE}, { ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN }, { ui::VKEY_OEM_2, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN }, }; @@ -51,9 +51,11 @@ void KeyboardOverlayView::Cancel() { bool KeyboardOverlayView::IsCancelingKeyEvent(ui::KeyEvent* event) { if (event->type() != ui::ET_KEY_PRESSED) return false; + // Ignore the caps lock state. + const int flags = (event->flags() & ~ui::EF_CAPS_LOCK_DOWN); for (size_t i = 0; i < arraysize(kCancelKeys); ++i) { if ((kCancelKeys[i].key_code == event->key_code()) && - (kCancelKeys[i].flags == event->flags())) + (kCancelKeys[i].flags == flags)) return true; } return false; |