From d537c9b002ced3162d24026132ca523e82cd3c5b Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Sun, 11 Dec 2022 21:27:43 +0200 Subject: [PATCH] fix button mapping for SpaceMouse Pro I expected the SpaceMouse Pro to report 256 buttons like the SpaceMouse Enterprise, and was too cautious in dropping the remapping otherwise. It turns out it reports 15 buttons, but still produces disjointed button numbers. So remove the check and just log the reported number of buttons before remapping for future debugging. --- src/dev_usb_linux.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/dev_usb_linux.c b/src/dev_usb_linux.c index a23bc13..5868b08 100644 --- a/src/dev_usb_linux.c +++ b/src/dev_usb_linux.c @@ -149,17 +149,12 @@ int open_dev_usb(struct device *dev) dev->bnbase = 0; } - /* sanity check, problematic devices appear to report 256 buttons, if that's - * not the case, this is probably a mistake. + /* for devices marked for disjointed button range remapping, log the button + * count reported before applying the remapping function */ - if(dev->bnhack && dev->num_buttons < 255) { - logmsg(LOG_DEBUG, "BUG! Please report this at https://github.com/FreeSpacenav/spacenavd/issues, " - "or by sending an email to nuclear@member.fsf.org.\n"); - logmsg(LOG_DEBUG, "This device (%04x:%04x) was marked for disjointed " - "button remapping, but unexpectedly reports %d buttons\n", + if(dev->bnhack) { + logmsg(LOG_DEBUG, "Device %04x:%04x reports %d buttons before disjointed button remapping\n", dev->usbid[0], dev->usbid[1], dev->num_buttons); - - dev->bnhack = 0; } if(dev->bnhack) {