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

Unified Diff: ui/events/ozone/evdev/input_device_factory_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
Index: ui/events/ozone/evdev/input_device_factory_evdev.cc
diff --git a/ui/events/ozone/evdev/input_device_factory_evdev.cc b/ui/events/ozone/evdev/input_device_factory_evdev.cc
index e2140f66add03ec8624a1cf967693c00dc968e17..0fc241ed4d0c284d112fbf3a6b19303c93cf65a5 100644
--- a/ui/events/ozone/evdev/input_device_factory_evdev.cc
+++ b/ui/events/ozone/evdev/input_device_factory_evdev.cc
@@ -142,7 +142,7 @@ void OpenInputDevice(scoped_ptr<OpenInputDeviceParams> params,
TRACE_EVENT1("ozone", "OpenInputDevice", "path", path.value());
- int fd = open(path.value().c_str(), O_RDONLY | O_NONBLOCK);
+ int fd = open(path.value().c_str(), O_RDWR | O_NONBLOCK);
if (fd < 0) {
PLOG(ERROR) << "Cannot open '" << path.value();
reply_runner->PostTask(
@@ -200,6 +200,7 @@ InputDeviceFactoryEvdev::InputDeviceFactoryEvdev(
keyboard_list_dirty_(false),
mouse_list_dirty_(false),
touchpad_list_dirty_(false),
+ caps_lock_led_enabled_(false),
weak_ptr_factory_(this) {
}
@@ -256,6 +257,7 @@ void InputDeviceFactoryEvdev::AttachInputDevice(
// Sync settings to new device.
ApplyInputDeviceSettings();
+ ApplyCapsLockLed();
}
if (--pending_device_changes_ == 0)
@@ -328,6 +330,11 @@ void InputDeviceFactoryEvdev::EnableInternalKeyboard() {
}
}
+void InputDeviceFactoryEvdev::SetCapsLockLed(bool enabled) {
+ caps_lock_led_enabled_ = enabled;
+ ApplyCapsLockLed();
+}
+
void InputDeviceFactoryEvdev::UpdateInputDeviceSettings(
const InputDeviceSettingsEvdev& settings) {
input_device_settings_ = settings;
@@ -385,6 +392,13 @@ void InputDeviceFactoryEvdev::ApplyInputDeviceSettings() {
input_device_settings_.tap_to_click_paused);
}
+void InputDeviceFactoryEvdev::ApplyCapsLockLed() {
+ for (const auto& it : converters_) {
+ EventConverterEvdev* converter = it.second;
+ converter->SetCapsLockLed(caps_lock_led_enabled_);
+ }
+}
+
void InputDeviceFactoryEvdev::UpdateDirtyFlags(
const EventConverterEvdev* converter) {
if (converter->HasTouchscreen())
« no previous file with comments | « ui/events/ozone/evdev/input_device_factory_evdev.h ('k') | ui/events/ozone/evdev/input_device_factory_evdev_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698