[chuck-users] odd hid issue (touchpad)

Spencer Salazar ssalazar at CS.Princeton.EDU
Sat Jul 18 20:22:19 EDT 2009


Hey Kassen,

One thing to try is to see if you can read any data from the  
underlying input file for that device.  To get the file path, try  
running a basic ChucK program that opens that mouse (e.g. hid/mouse.ck  
from the examples directory) and then use lsof:

chuck examples/hid/mouse.ck >& /dev/null &
lsof -c chuck | grep event

lsof will list all files of the form /dev/input/event# at least once;  
the one that is listed twice is the one you want.  Take that file path  
(for me its /dev/input/event5) and pass it to od:

od < /dev/input/event5

and then move your mouse around.  If you see a bunch of binary data in  
octal format printed to the screen roughly at the same time as when  
you move the mouse around, then it seems likely chuck is mishandling  
or misinterpreting the input from this device.  If you don't see that  
or anything else printed to the screen when running this command, then  
probably at some lower level this device is identifying itself but  
does not actually provide data through the standard channels.  If its  
the former then let me know and we can try to figure out in greater  
depth what data this device is reporting that chuck seems to have such  
a problem with; in the latter case there is probably not much that  
chuck can do.

On another note, I recall that I owe you a response to your chuck-dev  
post a few weeks ago; thats forthcoming :)

spencer

On Jul 17, 2009, at 6:58 AM, Kassen wrote:

> Hans;
>
> You might want to have a look at the spacenavigator thread, for  
> example
>  https://lists.cs.princeton.edu/pipermail/chuck-users/2009-May/004258.html
> and what follows.
>
> That is a very different issue, in that case we were dealing with a  
> device of a type unknown to ChucK. Here we are dealing with a laptop  
> touchpad and touchpads work as mice (in addition to the other  
> capabilities that you outline below which we don't yet deal with).  
> Up to here ChucK agrees with me, this is what it prints when running  
> mouse.ck;
>
> [chuck](VM): sporking incoming shred: 1 (mouse.ck)...
> mouse 'SynPS/2 Synaptics TouchPad' ready
>
>
> The HIDs work so that they have a series of button which can give  
> range of values and they are also marked for intended use. So a  
> mouse report relative position or velocities (don't remember which),  
> whereas a trackpad report absolute position - a different variable.
>
> I do believe touchpads also output the change in position. I think  
> it might be interesting to also read this absolute position for  
> ChaosPad style modulations but that's something for the wishlist.  
> Touchpads should work -I feel- and generally they do; Plork/Slork  
> did play "bowed touchpad" by swiping them and sending the resultant  
> signal to some sort of soundsource in ChucK.
>
> I hacked up a program that reports them all on Mac OS X.
>
> Chuck only implements a few of them.
>
> That is true. I think part of the reason for that is that they  
> aren't very standardised. Some touchpads also report on the pressure  
> excerted and others do things like multi-touch. I would imagine that  
> a Synaptic touchpad on a off-the-shelf laptop should be fairly  
> standard, at least at it's core.
>
>
> On Mac OS X, all HISs in each category start at 0. So there is no  
> need going up in numbers.
>
> I'm not sure what you mean by that; the first one is indeed always  
> called "0" but that may not be the one we are interested in or we  
> may be using several devices at the same time; I regularly perform  
> with 3 joystick devices, for example.
>
> Yours,
> Kas.
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users



More information about the chuck-users mailing list