summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-11-18 15:31:23 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-11-24 11:01:25 +1000
commita323e221a715997aae6738acb106b86aed344355 (patch)
tree899577a1628337485ebd2e9dfee8fe292af23b8d
parent6385974e4dc74e1e742e485b68aa037c68c55fa9 (diff)
Use the button conversion helper for normal button events too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-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);
}