Skip to content

Instantly share code, notes, and snippets.

@iquiw
Created August 2, 2015 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iquiw/d3b946b9cfe2fd088b9e to your computer and use it in GitHub Desktop.
Save iquiw/d3b946b9cfe2fd088b9e to your computer and use it in GitHub Desktop.
Support upper 2 buttons of Kensington SlimBlade
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
index 4d7745b..eb6f095 100644
--- a/sys/dev/usb/ums.c
+++ b/sys/dev/usb/ums.c
@@ -334,6 +334,12 @@ ums_attach(device_t parent, device_t self, void *aux)
}
}
}
+ for (size_t j = 1; i <= MAX_BUTTONS && j <= 2; i++, j++) {
+ if (!hid_locate(desc, size, HID_USAGE2(HUP_MICROSOFT, j),
+ uha->reportid, hid_input, &sc->sc_loc_btn[i - 1], 0)) {
+ break;
+ }
+ }
sc->nbuttons = i - 1;
aprint_normal(": %d button%s%s%s%s%s%s%s%s%s\n",
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment