Commit ce85b11e authored by Peter Hutterer's avatar Peter Hutterer

Fix button offset for tablet pad buttons

4-7 is reserved for scroll buttons, as usual
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 77a47a79
......@@ -985,7 +985,7 @@ xf86libinput_init_tablet_pad(InputInfoPtr pInfo)
int nbuttons;
int naxes = 7;
nbuttons = libinput_device_tablet_pad_get_num_buttons(device);
nbuttons = libinput_device_tablet_pad_get_num_buttons(device) + 4;
init_button_map(btnmap, nbuttons);
InitPointerDeviceStruct((DevicePtr)dev,
......@@ -1565,6 +1565,8 @@ xf86libinput_handle_tablet_pad_button(InputInfoPtr pInfo,
return;
button = 1 + libinput_event_tablet_pad_get_button_number(event);
if (button > 3)
button += 4; /* offset by scroll buttons */
is_press = (libinput_event_tablet_pad_get_button_state(event) == LIBINPUT_BUTTON_STATE_PRESSED);
xf86PostButtonEvent(dev, Relative, button, is_press, 0, 0);
......
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