In playing with [hid] a bit more, it appears that you can have it track when multiple keys are down. Just as a test, I pressed and held down keys, and once I get to the sixth key, no matter what key I pressed it would output 'key_1 1' for that key, and any subsequent keys that are pressed are not registered. Is the number of multiple keys restricted by [hid] or the system? Is 'key_1 1' an indicator that no more keys can be pressed?
Thanks,
Mike
On Thu, Mar 20, 2008 at 2:50 PM, Mike McGonagle mjmogo@gmail.com wrote:
On Thu, Mar 20, 2008 at 2:37 PM, Andrew Turley aturley@acm.org wrote:
I don't know exactly what you're trying to do, but it might just be easier to use [key], [keyup] and [keyname].
Well, it was actually more of a learning experiment in trying to deal with [hid] objects. Eventually, I would like to get some sort of dedicated controller (possibly some game controller, or maybe a built one using arduino)...
I did test your suggestion, and a couple of things came up that I noticed that would make using either [key] (and related) or [hid] differently.
- [key] does not output anything unless the patch containing it is the
front window. 2. [key] outputs any 'key-repeats' that the system generates, while [hid] does not.
I did notice one thing that is kind of weird in using [hid]... when I opened up the keyboard (device 0) and started it polling, any output from the keyboard is normal... I then turn off the polling, and type some more stuff... I then turn the polling back on, and everything that I typed while it was off gets output from [hid]...
Strange.
But if you do want to use [hid], once you have the device open you have to send a [1( to start polling. You might want to just hook a [print] object to the output to see what kind of info is coming out, and then [route] the messages accordingly.
Yup, got this to work, and am looking forward to testing it out on my laptop at home tonight...
Mike
-- Peace may sound simple—one beautiful word— but it requires everything we have, every quality, every strength, every dream, every high ideal. —Yehudi Menuhin (1916–1999), musician