From 3bdaa3e2491d638bb95260f6c50c3cb170f66cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 1 Jul 2013 12:48:55 -0400 Subject: [PATCH] touchpad: Handle two-finger click as right click for button pads --- src/evdev-touchpad.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c index a21ae0b2..53300ce8 100644 --- a/src/evdev-touchpad.c +++ b/src/evdev-touchpad.c @@ -571,6 +571,8 @@ process_key(struct touchpad_dispatch *touchpad, struct input_event *e, uint32_t time) { + uint32_t code; + switch (e->code) { case BTN_TOUCH: if (!touchpad->has_pressure) { @@ -588,8 +590,12 @@ process_key(struct touchpad_dispatch *touchpad, case BTN_FORWARD: case BTN_BACK: case BTN_TASK: - notify_button(device->seat, - time, e->code, + if (!touchpad->fsm.enable && e->code == BTN_LEFT && + touchpad->finger_state == TOUCHPAD_FINGERS_TWO) + code = BTN_RIGHT; + else + code = e->code; + notify_button(device->seat, time, code, e->value ? WL_POINTER_BUTTON_STATE_PRESSED : WL_POINTER_BUTTON_STATE_RELEASED); break;