← Back to team overview

multi-touch-dev team mailing list archive

Re: script to detect MT devices

 

Nice script.

My only reluctance to both the shell and the python, is:
# See linux/input.h
ABS_MT_POSITION_X = 0x35

Its not likely the change any time soon or all that often, but it would be nice to be able to use the constants straight out of the header files.

That sort of bit me already with the size of input_event on 32/64.

Probably not worth changing for now.


Duncan, the problem with the sysfs node is purely a number->string conversion. As Henrik said, anything that's actually using the raw values won't encounter that problem.

On 08/18/2010 11:33 AM, Marc Tardif wrote:
* Henrik Rydberg<rydberg@xxxxxxxxxxx>  [2010-08-18 14:03 +0200]:
On 08/18/2010 01:56 PM, Duncan McGreggor wrote:
Marc's script looks nice, but I was waiting to get a resolution to the
shell script/device/kernel issue before making some suggestions. Looks
like the script you attached is an updated version that cleverly works
around the issue.

Running the script no longer results in a traceback; I get results now.
However, not all the results I expected. My expectations may be awry due
to not knowing what the script outputs for other N-trig-based hardware.

Here's what I get:

Found device(s):
SynPS/2 Synaptics TouchPad: /dev/input/event6
N-Trig Pen: /dev/input/event9

Here's what I would expect (Henrik can correct my assumptions):

Found device(s):
SynPS/2 Synaptics TouchPad: /dev/input/event6
N-Trig Pen: /dev/input/event9
N-Trig MultiTouch: /dev/input/event10
N-Trig Touchscreen: /dev/input/event11

Unfortunately the python code is not correct - I get false positives on my
machine. It seems the split is over word, whereas the shell script splits on bits.

Thanks for the review and the update which included checking the LONG_BIT
of the underlying system. I have fixed and updated the Python script
accordingly, attached to this message. Enjoy once again!




_______________________________________________
Mailing list: https://launchpad.net/~multi-touch-dev
Post to     : multi-touch-dev@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~multi-touch-dev
More help   : https://help.launchpad.net/ListHelp



Follow ups

References