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

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

Issue 971753006: ozone: evdev: Sync caps lock LED state to evdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/PLOG/LOG/ for short write. errno is not set in this case 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/input_controller_evdev.h ('k') | ui/events/ozone/evdev/input_device_factory_evdev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/input_controller_evdev.cc
diff --git a/ui/events/ozone/evdev/input_controller_evdev.cc b/ui/events/ozone/evdev/input_controller_evdev.cc
index 19c728b39b70837a890a892e2009f66628ac0d85..9e65740b7adb5f8b1eb64ee64df2839613618a12 100644
--- a/ui/events/ozone/evdev/input_controller_evdev.cc
+++ b/ui/events/ozone/evdev/input_controller_evdev.cc
@@ -22,6 +22,7 @@ InputControllerEvdev::InputControllerEvdev(KeyboardEvdev* keyboard,
button_map_(button_map),
has_mouse_(false),
has_touchpad_(false),
+ caps_lock_led_state_(false),
weak_ptr_factory_(this) {
}
@@ -33,6 +34,7 @@ void InputControllerEvdev::SetInputDeviceFactory(
input_device_factory_ = input_device_factory;
UpdateDeviceSettings();
+ UpdateCapsLockLed();
}
void InputControllerEvdev::set_has_mouse(bool has_mouse) {
@@ -57,6 +59,7 @@ bool InputControllerEvdev::IsCapsLockEnabled() {
void InputControllerEvdev::SetCapsLockEnabled(bool enabled) {
keyboard_->SetCapsLockEnabled(enabled);
+ UpdateCapsLockLed();
}
void InputControllerEvdev::SetNumLockEnabled(bool enabled) {
@@ -178,4 +181,13 @@ void InputControllerEvdev::UpdateDeviceSettings() {
settings_update_pending_ = false;
}
+void InputControllerEvdev::UpdateCapsLockLed() {
+ if (!input_device_factory_)
+ return;
+ bool caps_lock_state = IsCapsLockEnabled();
+ if (caps_lock_state != caps_lock_led_state_)
+ input_device_factory_->SetCapsLockLed(caps_lock_state);
+ caps_lock_led_state_ = caps_lock_state;
+}
+
} // namespace ui
« no previous file with comments | « ui/events/ozone/evdev/input_controller_evdev.h ('k') | ui/events/ozone/evdev/input_device_factory_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698