[ltp] Changing sensitivity ThinkPad USB Keyboard with TrackPoint
Bjørn Mork
linux-thinkpad@linux-thinkpad.org
Fri, 11 May 2012 13:15:11 +0200
Quesillo Quesedor <quesilloquesedor@yahoo.com.ar> writes:
> I have this python script for changing the sensitivity of the trackp=
oint.
>
> #pyusb imports
> import usb.core
> import usb.util
>
> data = [0x4, 0x6a, 0x3, 0xfc, 0x38]
> dev = usb.core.find(idVendor=0x17ef, idProduct=0x6009)
>
> dev.ctrl_transfer(0x21, 0x9, 0x304, 0x1, data)
Just for anyone not immediately recognizing the usb_control_msg()
parameters:
0x21 == USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE
0x9 == HID_REQ_SET_REPORT (assuming the interface class is HID)
0x304 == report_type + 1 << 8 | report_id
0x1 == interface number
So I believe this is a "set report" request for report_type 2
(HID_FEATURE_REPORT) with report_id 4, sent as a control request
referencing interface 1 on the device. But I don't really know much
about HID so I may have gotten something wrong here.
Note that Bernhard Seibold created a simple driver for reading/setting
precisely this value via sysfs a year ago:
http://www.spinics.net/lists/linux-input/msg15423.html
Don't know why that hasn't been merged yet. CCing Bernhard to ensure
that he is aware of this discussion.
Bjørn