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

Unified Diff: ui/events/ozone/evdev/keyboard_evdev.cc

Issue 959923002: Fix CapsLock remapping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test Created 5 years, 10 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 | « ui/events/ozone/evdev/event_modifiers_evdev.cc ('k') | ui/events/ozone/layout/layout_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/keyboard_evdev.cc
diff --git a/ui/events/ozone/evdev/keyboard_evdev.cc b/ui/events/ozone/evdev/keyboard_evdev.cc
index 0132616cb6eb381e5e3cd282cca7fa37fcccfbe5..7b25feab396f7849f7312cd14c3da874998fc197 100644
--- a/ui/events/ozone/evdev/keyboard_evdev.cc
+++ b/ui/events/ozone/evdev/keyboard_evdev.cc
@@ -46,10 +46,6 @@ int EventFlagToEvdevModifier(int flag) {
}
}
-bool IsModifierLock(int evdev_modifier) {
- return evdev_modifier == EVDEV_MODIFIER_CAPS_LOCK;
-}
-
} // namespace
KeyboardEvdev::KeyboardEvdev(EventModifiersEvdev* modifiers,
@@ -122,8 +118,15 @@ void KeyboardEvdev::UpdateModifier(int modifier_flag, bool down) {
if (modifier == EVDEV_MODIFIER_NONE)
return;
- if (IsModifierLock(modifier))
- modifiers_->UpdateModifierLock(modifier, down);
+ // TODO post-X11: Revise remapping to not use EF_MOD3_DOWN.
+ // Currently EF_MOD3_DOWN means that the CapsLock key is currently down,
+ // and EF_CAPS_LOCK_DOWN means the caps lock state is enabled (and the
+ // key may or may not be down, but usually isn't). There does need to
+ // to be two different flags, since the physical CapsLock key is subject
+ // to remapping, but the caps lock state (which can be triggered in a
+ // variety of ways) is not.
+ if (modifier == EVDEV_MODIFIER_CAPS_LOCK)
+ modifiers_->UpdateModifier(EVDEV_MODIFIER_MOD3, down);
else
modifiers_->UpdateModifier(modifier, down);
}
« no previous file with comments | « ui/events/ozone/evdev/event_modifiers_evdev.cc ('k') | ui/events/ozone/layout/layout_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698