Date: Sat, 21 Aug 2010 17:23:06 +0900 From: "Lee, Chung-Yeol" <chungyeol.lee@gmail.com> To: freebsd-questions@freebsd.org Subject: Use extra buttons of Kensington Slimblade Trackball Message-ID: <20100821082306.GA2204@genie.honey.home>
next in thread | raw e-mail | index | archive | help
--/9DWx/yDrRhgMJTb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
While I'm searching how to use the extra buttons in Kensington Slimblade
Trackball, I made a patch for myself based on the linux driver.
I confirmed it works as intended. However, I have no experience with the FreeBSD
kernel and I'm not sure that I modified it in a correct way. -- especially,
I don't know should I use usb_quirks?
Can somebody check the attached diff file so that I can send problem report?
Thanks.
--/9DWx/yDrRhgMJTb
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="ums.diff"
--- ums_orig.c 2010-08-21 16:43:53.000000000 +0900
+++ ums.c 2010-08-21 16:47:48.000000000 +0900
@@ -405,7 +405,7 @@
{
struct ums_info *info = &sc->sc_info[index];
uint32_t flags;
- uint8_t i;
+ uint8_t i, 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)) {
@@ -483,6 +483,16 @@
break;
}
}
+
+ /* Detect other buttons */
+ for (j = 0; j < 2; 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;
+ }
+ i++;
+ }
info->sc_buttons = i;
if (i > sc->sc_buttons)
--/9DWx/yDrRhgMJTb--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100821082306.GA2204>
