The problem with writing a generic event interface object is that the number of outlets would change for every device, so for example, if you wrote your patch for a mouse with a wheel, that would give you three outlets for the x, y, and wheel axes. But then throw in a mouse with no wheel, and you'll get one less outlet, and your patch is broken.
This is the problem I have with J Sarlo's joystick object, the outlets are dynamically assigned based on the device. So if I want to write a instrument using a joystick controller so others could use it, they would have to be sure to have the same axes as my joystick. So if their joystick didn't have a hat switch, the patch would break.
The way to write a generic event interface object would be to have it use outlets for event types and codes. But this would be a pain to work with, since you would have to know about the Linux event interface types and codes, and you would have to [route] all those messages to where you want them.
.hc
On Tue, 8 Apr 2003, Christian Klippel wrote:
hi,
Am Dienstag, 8. April 2003 15:20 schrieb Hans-Christoph Steiner:
I am currently working on a Pd_linux object called [rawmouse] which reads info direct from the Linux event interface. Once its done, it should be trivial to make a [rawtablet] object. But its not done yet...
.hc
if you read the event device, you can make a general purpose object. just read the event, and give it to either seperate outlets (type,code,value1,value2) or as list on a single outlet. there is an timestamp in the event message also, if needed, that could be given an outlet.....
that way it can be used with any event device, mice, tablets, joysticks, pens... its then just up to the patch to decode the needed events. one can make simple patches for a ready-to-use mouse decoder based on that, for example.
greets,
chris
zen
\
\
\[D[D[D[D