Commit 9dfb808f authored by spang's avatar spang Committed by Commit bot

ozone: evdev: Squelch unknown key errors for mouse & digi from gestures

These are uninteresting because they are not keyboard keys and because
they are redundant with button presses & MT contacts in gestures. We
could possibly pass on the "tool" used (BTN_TOOL_*) for touch, but we
currently don't use it.

BUG=none
TEST=ran chrome on link_freon, no more "unknown key" errors

Review URL: https://codereview.chromium.org/703493002

Cr-Commit-Position: refs/heads/master@{#302527}
parent 5b104332
...@@ -437,10 +437,20 @@ void GestureInterpreterLibevdevCros::DispatchChangedKeys(Evdev* evdev, ...@@ -437,10 +437,20 @@ void GestureInterpreterLibevdevCros::DispatchChangedKeys(Evdev* evdev,
key_state_diff[i] = evdev->key_state_bitmask[i] ^ prev_key_state_[i]; key_state_diff[i] = evdev->key_state_bitmask[i] ^ prev_key_state_[i];
// Dispatch events for changed keys. // Dispatch events for changed keys.
for (unsigned long i = 0; i < KEY_CNT; ++i) { for (unsigned long key = 0; key < KEY_CNT; ++key) {
if (EvdevBitIsSet(key_state_diff, i)) { if (EvdevBitIsSet(key_state_diff, key)) {
bool value = EvdevBitIsSet(evdev->key_state_bitmask, i); bool value = EvdevBitIsSet(evdev->key_state_bitmask, key);
keyboard_->OnKeyChange(i, value);
// 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);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment