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

Unified Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2763483002: Fix Caps Lock bug (Closed)
Patch Set: Add unit test for Caps Lock in accelerator. Created 3 years, 8 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
Index: ash/common/accelerators/accelerator_controller.cc
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index a95f9f6f369d2b4e87ed728db3ca59f1b443c782..10bf9f44a642f4f9dab69537b690dad8613017f2 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -583,6 +583,12 @@ bool CanHandleToggleCapsLock(const ui::Accelerator& accelerator,
}
}
+ // Caps Lock release
+ if (accelerator.key_code() == ui::VKEY_CAPITAL &&
+ accelerator.key_state() == ui::Accelerator::KeyState::RELEASED) {
+ return ime && ime->GetImeKeyboard();
afakhry 2017/04/07 23:31:42 Can we move the check for |ime| is not null up to
weidongg 2017/04/08 00:15:07 Sure, you are right.
+ }
+
return false;
}

Powered by Google App Engine
This is Rietveld 408576698