diff --git a/share/man/man4/hidquirk.4 b/share/man/man4/hidquirk.4 index aa78e189765c..cbe0e33c934c 100644 --- a/share/man/man4/hidquirk.4 +++ b/share/man/man4/hidquirk.4 @@ -53,6 +53,8 @@ doesn't identify properly mouse sends an unknown leading byte .It HQ_MS_REVZ mouse has Z-axis reversed +.It HQ_MS_VENDOR_BTN +mouse has buttons in vendor usage page .It HQ_SPUR_BUT_UP spurious mouse button up events .It HQ_MT_TIMESTAMP diff --git a/sys/dev/hid/hidquirk.c b/sys/dev/hid/hidquirk.c index 7c28e240582b..dfb97a3e5597 100644 --- a/sys/dev/hid/hidquirk.c +++ b/sys/dev/hid/hidquirk.c @@ -151,6 +151,8 @@ static struct hidquirk_entry hidquirks[HID_DEV_QUIRKS_MAX] = { USB_QUIRK(CORSAIR, STRAFE2, 0x0000, 0xffff, HQ_KBD_BOOTPROTO), /* Holtek USB gaming keyboard */ USB_QUIRK(HOLTEK, F85, 0x0000, 0xffff, HQ_KBD_BOOTPROTO), + /* Quirk for Kensington Slimblade Trackball */ + USB_QUIRK(KENSINGTON, SLIMBLADE, 0x0000, 0xffff, HQ_MS_VENDOR_BTN), }; #undef HID_QUIRK_VP #undef USB_QUIRK diff --git a/sys/dev/hid/hidquirk.h b/sys/dev/hid/hidquirk.h index 0201f2f0746c..5f0dafb8a8a2 100644 --- a/sys/dev/hid/hidquirk.h +++ b/sys/dev/hid/hidquirk.h @@ -59,6 +59,7 @@ HQ(MS_BAD_CLASS), /* doesn't identify properly */ \ HQ(MS_LEADING_BYTE), /* mouse sends an unknown leading byte */ \ HQ(MS_REVZ), /* mouse has Z-axis reversed */ \ + HQ(MS_VENDOR_BTN), /* mouse has buttons in vendor usage page */ \ HQ(SPUR_BUT_UP), /* spurious mouse button up events */ \ HQ(MT_TIMESTAMP) /* Multitouch device exports HW timestamps */ diff --git a/sys/dev/hid/hms.c b/sys/dev/hid/hms.c index b1580c3db358..87d207cc3f6b 100644 --- a/sys/dev/hid/hms.c +++ b/sys/dev/hid/hms.c @@ -61,8 +61,6 @@ enum { HMS_ABS_Z, HMS_HWHEEL, HMS_BTN, - HMS_BTN_MS1, - HMS_BTN_MS2, HMS_FINAL_CB, }; @@ -95,8 +93,6 @@ static const struct hidmap_item hms_map[] = { [HMS_ABS_Z] = HMS_MAP_ABS(HUG_Z, ABS_Z), [HMS_HWHEEL] = HMS_MAP_REL_CN(HUC_AC_PAN, REL_HWHEEL), [HMS_BTN] = HMS_MAP_BUT_RG(1, 16, BTN_MOUSE), - [HMS_BTN_MS1] = HMS_MAP_BUT_MS(1, BTN_RIGHT), - [HMS_BTN_MS2] = HMS_MAP_BUT_MS(2, BTN_MIDDLE), [HMS_FINAL_CB] = HMS_FINAL_CB(hms_final_cb), }; @@ -107,6 +103,11 @@ static const struct hidmap_item hms_map_wheel_rev[] = { HMS_MAP_REL_REV(HUG_WHEEL, REL_WHEEL), }; +static const struct hidmap_item hms_map_kensington_slimblade[] = { + HMS_MAP_BUT_MS(1, BTN_RIGHT), + HMS_MAP_BUT_MS(2, BTN_MIDDLE), +}; + /* A match on these entries will load hms */ static const struct hid_device_id hms_devs[] = { { HID_TLC(HUP_GENERIC_DESKTOP, HUG_POINTER) }, @@ -261,6 +262,9 @@ hms_attach(device_t dev) else HIDMAP_ADD_MAP(&sc->hm, hms_map_wheel, cap_wheel); + if (hid_test_quirk(hw, HQ_MS_VENDOR_BTN)) + HIDMAP_ADD_MAP(&sc->hm, hms_map_kensington_slimblade, NULL); + #ifdef IICHID_SAMPLING if (hid_test_quirk(hw, HQ_IICHID_SAMPLING) && hidmap_test_cap(sc->caps, HMS_REL_X) &&