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

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

Issue 806693009: Port ScopedDisableInternalMouseAndKeyboardX11 to Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/keyboard_evdev.cc
diff --git a/ui/events/ozone/evdev/keyboard_evdev.cc b/ui/events/ozone/evdev/keyboard_evdev.cc
index de7d84ac997e63ea275da4d3f9aa56ce278502f8..c569bb9a8a3de3629cc61bc1d7af37e6923e454d 100644
--- a/ui/events/ozone/evdev/keyboard_evdev.cc
+++ b/ui/events/ozone/evdev/keyboard_evdev.cc
@@ -156,7 +156,7 @@ void KeyboardEvdev::OnRepeatIntervalTimeout() {
void KeyboardEvdev::DispatchKey(unsigned int key, bool down, bool repeat) {
DomCode dom_code =
- KeycodeConverter::NativeKeycodeToDomCode(key + kXkbKeycodeOffset);
+ KeycodeConverter::NativeKeycodeToDomCode(EvdevCodeToNativeCode(key));
// DomCode constants are not included here because of conflicts with
// evdev preprocessor macros.
if (!static_cast<int>(dom_code))
@@ -189,4 +189,11 @@ int KeyboardEvdev::NativeCodeToEvdevCode(int native_code) {
return native_code - kXkbKeycodeOffset;
}
+// static
+int KeyboardEvdev::EvdevCodeToNativeCode(int evdev_code) {
+ if (evdev_code == KEY_RESERVED)
+ return KeycodeConverter::InvalidNativeKeycode();
+ return evdev_code + kXkbKeycodeOffset;
+}
+
} // namespace ui
« no previous file with comments | « ui/events/ozone/evdev/keyboard_evdev.h ('k') | ui/events/ozone/evdev/libgestures_glue/event_reader_libevdev_cros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698