[chuck-users] mouse position

Aylon Eduard eduard.aylon at gmail.com
Thu Oct 23 05:56:57 EDT 2008


thanks for you replies. However it seems strange that fdata tracks perfectly
the pointer position (in range [0,1]) on the horizontal axis with fdata, so
I'd expected that there would be a data member for the vertical axis. (i.e.
fdata being a tuple)
Check the attached patch that outputs fdata.

Hid mouse;
HidMsg msg;

if (!mouse.openMouse(0)) me.exit();

while (true)
 mouse => now;
 while (mouse.recv( msg ))
   if (msg.isMouseMotion())
       <<< "which: ", msg.which, "data:", msg.fdata,  "Delta:", msg.deltaX,


On Thu, Oct 23, 2008 at 10:29 AM, Kassen <signal.automatique at gmail.com>wrote:

> 2008/10/23 Joel Matthys <jwmatthys at yahoo.com>
>> Actually, this is an interesting question. Hid tracks mouse motion rather
>> than mouse position, so it's not so easy to create a ChucK patch that
>> depends on the mouse's position on the screen. (ie trigger a sound when the
>> mouse is in the upper left hand corner.)
> Indeed, the cursor position is something to be dealt with by the graphical
> shell of the OS, not the HID device. They are related but still different
> things. It would be interesting to be able to poll the OS for various
> things; it's there to take care of the basics, as far as I'm concerned it
> can earn it's stay... the downside is that I understand that calls to the OS
> tend to be slow and typically not realtime; some realtime OS's have been
> made but the large two OS companies don't seem to think this is particularly
> important. There are realtime versions of the Linux kernel (and running one
> can make lots of sense for ChucKing) but I'm not at all sure that also means
> the X-windowing system will be rt as well.
> On the other hand; some pointing devices *do* have absolute locations;
> tablets and touch-screens do and in that case the absolute position on the
> tablet should correspond to the absolute position of the mouse pointer and
> that's something we *could* poll HID for. Another potentially interesting
> angle might be the touch-pads on most laptops. I could see Laptop-Orchestra
> style uses for reading absolute locations from those as well as data like
> the amount of pressure used. Sadly the more exciting features are there, the
> less likely they'll be to be standardised. Multi-touch surfaces would be
> great to be able to talk to, as would be pressure sesitivity (finger
> drumming, anyone?) but I'm sure we could support those things (where
> available) across devices and OS's.
> Yours,
> Kas.
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20081023/c1e3ab69/attachment.html>

More information about the chuck-users mailing list