[ltp] Changing sensitivity ThinkPad USB Keyboard with TrackPoint
Quesillo Quesedor
linux-thinkpad@linux-thinkpad.org
Wed, 9 May 2012 18:04:44 -0700 (PDT)
--607472424-1918087706-1336611884=:92666
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Hello=A0=0A=0AI have this python script for changing the=A0sensitivity of t=
he trackpoint.=0A=0A#pyusb imports=0Aimport usb.core=A0=0Aimport usb.util=
=0A=0Adata =3D [0x4, 0x6a, 0x3, 0xfc, 0x38]=0Adev =3D usb.core.find(idVendo=
r=3D0x17ef, idProduct=3D0x6009)=0A=0Adev.ctrl_transfer(0x21, 0x9, 0x304, 0x=
1,=A0data)=0A=0A=0AIt needs root to be able to open the device and on linux=
you need to unbind the trackpoint device from usbhid module before you run=
the script=A0and then bind it back.=0A# echo XXX > /sys/bus/usb/drivers/us=
bhid/unbind=0A=0A# python2 trackpoint-script.py=0A#=A0echo XXX > /sys/bus/u=
sb/drivers/usbhid/bind=0AI did try to use Device.attach_kernel_driver but i=
t doesn't seems to work for the trackpoint interface.=0A=0Adata[3] is the v=
alue that changes the=A0sensitivity level, I found that the windows driver =
use one of the following values=0A0x66 0x72 0x80 0x8f 0xa0 0xb3 0xc9 0xe1 0=
xfc=0A=0A=0AThis script also works on OS X.
--607472424-1918087706-1336611884=:92666
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
<html><body><div style=3D"color:#000; background-color:#fff; font-family:ti=
mes new roman, new york, times, serif;font-size:12pt"><div style=3D"font-fa=
mily: 'times new roman', 'new york', times, serif; font-size: 12pt; ">Hello=
</div><div style=3D"font-family: 'times new roman', 'new york', times=
, serif; font-size: 12pt; "><br></div><div style=3D"font-family: 'times new=
roman', 'new york', times, serif; font-size: 12pt; ">I have this python sc=
ript for changing the sensitivity of the trackpoint.</div><div style=
=3D"font-family: 'times new roman', 'new york', times, serif; font-size: 12=
pt; "><br></div><div style=3D"font-family: 'times new roman', 'new york', t=
imes, serif; font-size: 12pt; ">#pyusb imports</div><div><div><font face=3D=
"'times new roman', 'new york', times, serif">import usb.core </font><=
/div><div><font face=3D"'times new roman', 'new york', times, serif">import=
usb.util</font></div><div><font face=3D"'times new roman', 'new york', tim=
es,
serif"><br></font></div><div><font face=3D"'times new roman', 'new york', =
times, serif">data =3D [0x4, 0x6a, 0x3, 0xfc, 0x38]</font></div><div><span =
style=3D"font-family: 'times new roman', 'new york', times, serif; ">dev =
=3D usb.core.find(idVendor=3D0x17ef, idProduct=3D0x6009)</span><br></div><d=
iv><span style=3D"font-family: 'times new roman', 'new york', times, serif;=
">dev.ctrl_transfer(0x21, 0x9, 0x304, 0x1, </span><span style=3D"font=
-family: 'times new roman', 'new york', times, serif; ">data</span><span st=
yle=3D"font-family: 'times new roman', 'new york', times, serif; ">)</span>=
<br></div><div><span style=3D"font-family: 'times new roman', 'new york', t=
imes, serif; "><br></span></div><div><font face=3D"'times new roman', 'new =
york', times, serif">It needs root to be able to open the device and on lin=
ux you need to unbind the trackpoint device from usbhid module before you r=
un the script </font><span style=3D"font-family: 'times new roman', 'n=
ew york', times,
serif; ">and then bind it back</span><span style=3D"font-family: 'times ne=
w roman', 'new york', times, serif; ">.</span></div><div><font face=3D"'tim=
es new roman', 'new york', times, serif"><div># echo XXX > /sys/bus/usb/=
drivers/usbhid/unbind<br></div><div># python2 trackpoint-script.py</div><di=
v># echo XXX > /sys/bus/usb/drivers/usbhid/bind</div><div>I did try=
to use Device.attach_kernel_driver but it doesn't seems to work for the tr=
ackpoint interface.</div><div><br></div></font></div><div><font face=3D"'ti=
mes new roman', 'new york', times, serif">data[3] is the value that changes=
the </font><span style=3D"font-family: 'times new roman', 'new york',=
times, serif; font-size: 16px; ">sensitivity level, I found that the windo=
ws driver use one of the following values</span></div><div><font face=3D"'t=
imes new roman', 'new york', times, serif">0x66 0x72 0x80 0x8f 0xa0 0xb3 0x=
c9 0xe1 0xfc<br></font></div><div><font face=3D"'times new roman', 'new yor=
k',
times, serif"><br></font></div><div><font face=3D"'times new roman', 'new =
york', times, serif">This script also works on OS X.</font></div></div></di=
v></body></html>
--607472424-1918087706-1336611884=:92666--