From 94a52a848801ff035ec4d1c604dac7c90708e562 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 15 Jun 2023 15:00:54 +1000 Subject: [PATCH] tablet: map BTN_STYLUS3 to button 8 Buttons 4-7 are out of bounds for hysterical historical reasons. Previously this button fell through to the default statement and resulted in 8 + BTN_STYLUS3 - BTN_SIDE == 65 which is rather obviously wrong. Instead, map it explicitly to what the fourth button would be mapped to on other devices. This will now overlap with BTN_SIDE on devices that both BTN_STYLUS3 *and* BTN_SIDE but those devices don't appear to exist in the real world. Fixes #50 Signed-off-by: Peter Hutterer --- src/xf86libinput.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index b2ae804..b811ce0 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -256,6 +256,7 @@ btn_linux2xorg(unsigned int b) /* tablet button range */ case BTN_STYLUS: button = 2; break; case BTN_STYLUS2: button = 3; break; + case BTN_STYLUS3: button = 8; break; default: button = 8 + b - BTN_SIDE; break;