diff options
author | thompsa <thompsa@FreeBSD.org> | 2010-09-02 03:44:56 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2010-09-02 03:44:56 +0000 |
commit | 052a1466647cc9ebcfc2d465467b0e6838de2e2e (patch) | |
tree | a4ef45f82222dc1e225cc4739e54d3df2c55d01f /sys/dev/usb/input/ums.c | |
parent | 6d3d5806cd260f9eb24aff6d6b0f69e23e316ebb (diff) | |
download | FreeBSD-src-052a1466647cc9ebcfc2d465467b0e6838de2e2e.zip FreeBSD-src-052a1466647cc9ebcfc2d465467b0e6838de2e2e.tar.gz |
Add support for extra buttons on the Kensington Slimblade Trackball.
Submitted by: Lee, Chung-Yeol
Diffstat (limited to 'sys/dev/usb/input/ums.c')
-rw-r--r-- | sys/dev/usb/input/ums.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 7a2d053..1a5acc79 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -399,6 +399,7 @@ ums_hid_parse(struct ums_softc *sc, device_t dev, const uint8_t *buf, struct ums_info *info = &sc->sc_info[index]; uint32_t flags; uint8_t i; + uint8_t j; if (hid_locate(buf, len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X), hid_input, index, &info->sc_loc_x, &flags, &info->sc_iid_x)) { @@ -476,6 +477,17 @@ ums_hid_parse(struct ums_softc *sc, device_t dev, const uint8_t *buf, break; } } + + /* detect other buttons */ + + for (j = 0; (i < UMS_BUTTONS_MAX) && (j < 2); i++, j++) { + if (!hid_locate(buf, len, HID_USAGE2(HUP_MICROSOFT, (j + 1)), + hid_input, index, &info->sc_loc_btn[i], NULL, + &info->sc_iid_btn[i])) { + break; + } + } + info->sc_buttons = i; if (i > sc->sc_buttons) |