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

Unified Diff: chrome/browser/chromeos/events/event_rewriter.cc

Issue 2763483002: Fix Caps Lock bug (Closed)
Patch Set: q Created 3 years, 9 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 | ui/events/event.cc » ('j') | ui/events/event.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/events/event_rewriter.cc
diff --git a/chrome/browser/chromeos/events/event_rewriter.cc b/chrome/browser/chromeos/events/event_rewriter.cc
index d622d52f11b2bf35d87509c276640b6c40a715a7..54f4bc00e2e38756d101f7f5a2d59529ca817344 100644
--- a/chrome/browser/chromeos/events/event_rewriter.cc
+++ b/chrome/browser/chromeos/events/event_rewriter.cc
@@ -876,7 +876,10 @@ bool EventRewriter::RewriteModifierKeys(const ui::KeyEvent& key_event,
? ime_keyboard_for_testing_
: chromeos::input_method::InputMethodManager::Get()
->GetImeKeyboard();
- ime_keyboard->SetCapsLockEnabled(!ime_keyboard->CapsLockIsEnabled());
+ // Toggle Caps Lock if it is not repeated key event.
+ // Prevent continuous toggles when the key is hold down.
+ if (!key_event.is_repeat())
+ ime_keyboard->SetCapsLockEnabled(!ime_keyboard->CapsLockIsEnabled());
}
}
return exact_event;
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | ui/events/event.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698