summaryrefslogtreecommitdiff
path: root/src/libinput.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libinput.c')
-rw-r--r--src/libinput.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/libinput.c b/src/libinput.c
index 97b238f..c507ab7 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -515,13 +515,7 @@ xf86libinput_handle_button(InputInfoPtr pInfo, struct libinput_event_pointer *ev
int button;
int is_press;
- switch(libinput_event_pointer_get_button(event)) {
- case BTN_LEFT: button = 1; break;
- case BTN_MIDDLE: button = 2; break;
- case BTN_RIGHT: button = 3; break;
- default: /* no touchpad actually has those buttons */
- return;
- }
+ button = btn_linux2xorg(libinput_event_pointer_get_button(event));
is_press = (libinput_event_pointer_get_button_state(event) == LIBINPUT_BUTTON_STATE_PRESSED);
xf86PostButtonEvent(dev, Relative, button, is_press, 0, 0);
}