diff --git a/converter/adb_usb/config.h b/converter/adb_usb/config.h index 70c5e67d..a0996d03 100644 --- a/converter/adb_usb/config.h +++ b/converter/adb_usb/config.h @@ -42,6 +42,11 @@ along with this program. If not, see . // Mouse Extended Report #define MOUSE_EXT_REPORT +// Second button in Apple Classic Mouse protocol is ignored as Mac OS9 and OSX does. +// Without this some of 2-button mouses are unusable. +// https://github.com/tmk/tmk_keyboard/issues/724 +#define ADB_MOUSE_2ND_BUTTON_QUIRK + /* ADB port setting */ #define ADB_PORT PORTD diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c index 54ffb084..fd33aaaa 100644 --- a/converter/adb_usb/matrix.c +++ b/converter/adb_usb/matrix.c @@ -507,6 +507,13 @@ void adb_mouse_task(void) if (buf[0] & 0x40) yneg = true; if (buf[1] & 0x40) xneg = true; len = 2; + + #ifdef ADB_MOUSE_2ND_BUTTON_QUIRK + // Ignore b01('optional second button') as OSX/MacOS9 does. + // Some mouses misuse the bit and make it unusable. + // https://github.com/tmk/tmk_keyboard/issues/724 + buf[1] |= 0x80; + #endif } // Make unused buf bytes compatible with Extended Mouse Protocol