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

Unified Diff: ui/events/event.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 | « chrome/browser/chromeos/events/event_rewriter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index 8ebf5fc25b0dbfb6ed43ff0e09ec38e38f1b7322..635505d6a8b502313bb8e1f8c4595397ce79781c 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -1156,7 +1156,11 @@ bool KeyEvent::IsRepeated(const KeyEvent& event) {
return (last_key_event_->flags() & ui::EF_IS_REPEAT) != 0;
}
if (event.key_code() == last_key_event_->key_code() &&
- event.flags() == (last_key_event_->flags() & ~ui::EF_IS_REPEAT) &&
+ // Ignore Caps Lock flag. Otherwise, Caps Lock toggles continuously
+ // when the key is hold down.
+ (event.flags() & ~ui::EF_CAPS_LOCK_ON) ==
+ (last_key_event_->flags() & ~ui::EF_IS_REPEAT &
+ ~ui::EF_CAPS_LOCK_ON) &&
afakhry 2017/03/21 17:09:22 This doesn't look right. Clearing the CAPS LOCK fl
(event.time_stamp() - last_key_event_->time_stamp()).InMilliseconds() <
kMaxAutoRepeatTimeMs) {
last_key_event_->set_time_stamp(event.time_stamp());
« no previous file with comments | « chrome/browser/chromeos/events/event_rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698