[PATCH libinput 5/6] touchpad: enable middle button emulation on some touchpads

Peter Hutterer peter.hutterer at who-t.net
Tue Apr 14 20:51:17 PDT 2015


If the touchpad has left/right physical buttons but no middle button, force
middle button emulation - without a config option, it's always on.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-mt-touchpad-buttons.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index 56a054c..f64343c 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -694,6 +694,10 @@ tp_init_buttons(struct tp_dispatch *tp,
 
 	tp_init_top_softbuttons(tp, device, 1.0);
 
+	if (!tp->buttons.is_clickpad &&
+	    !libevdev_has_event_code(device->evdev, EV_KEY, BTN_MIDDLE))
+		evdev_init_middlebutton(tp->device, true, false);
+
 	tp_for_each_touch(tp, t) {
 		t->button.state = BUTTON_STATE_NONE;
 		libinput_timer_init(&t->button.timer,
-- 
2.3.4



More information about the wayland-devel mailing list