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

Unified Diff: ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc

Issue 703493002: ozone: evdev: Squelch unknown key errors for mouse & digi from gestures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
diff --git a/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc b/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
index 9bc7c8e355c34bbc1738a59a96e789e55dc2cad5..3e1c0d6d185be1910912571ce75a980cd0a8cde2 100644
--- a/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
+++ b/ui/events/ozone/evdev/libgestures_glue/gesture_interpreter_libevdev_cros.cc
@@ -437,10 +437,20 @@ void GestureInterpreterLibevdevCros::DispatchChangedKeys(Evdev* evdev,
key_state_diff[i] = evdev->key_state_bitmask[i] ^ prev_key_state_[i];
// Dispatch events for changed keys.
- for (unsigned long i = 0; i < KEY_CNT; ++i) {
- if (EvdevBitIsSet(key_state_diff, i)) {
- bool value = EvdevBitIsSet(evdev->key_state_bitmask, i);
- keyboard_->OnKeyChange(i, value);
+ for (unsigned long key = 0; key < KEY_CNT; ++key) {
+ if (EvdevBitIsSet(key_state_diff, key)) {
+ bool value = EvdevBitIsSet(evdev->key_state_bitmask, key);
+
+ // Mouse buttons are handled by DispatchMouseButton.
+ if (key >= BTN_MOUSE && key < BTN_JOYSTICK)
+ continue;
+
+ // Ignore digi buttons (e.g. BTN_TOOL_FINGER).
+ if (key >= BTN_DIGI && key < BTN_WHEEL)
+ continue;
+
+ // Dispatch key press or release to keyboard.
+ keyboard_->OnKeyChange(key, value);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698