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

Unified Diff: ash/keyboard_overlay/keyboard_overlay_view.cc

Issue 10826211: Ignore the caps lock state for closing the keyboard overlay. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/keyboard_overlay/keyboard_overlay_view.cc
diff --git a/ash/keyboard_overlay/keyboard_overlay_view.cc b/ash/keyboard_overlay/keyboard_overlay_view.cc
index 1831dcbff30300a459d8fac536f51e642f60780d..5c86e05e2959c1519e5c1984bcfc700f26fe138a 100644
--- a/ash/keyboard_overlay/keyboard_overlay_view.cc
+++ b/ash/keyboard_overlay/keyboard_overlay_view.cc
@@ -23,7 +23,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 },
};
@@ -50,9 +50,11 @@ void KeyboardOverlayView::Cancel() {
bool KeyboardOverlayView::IsCancelingKeyEvent(aura::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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698