[PD] keyboard-interface (hid?)
hans at eds.org
Thu Mar 3 20:56:45 CET 2005
On Mar 3, 2005, at 10:48 AM, Georg Holzmann wrote:
>> Unless you want to be an alpha tester for the [hid] object (which
>> would be much appreciated :), I would suggest using [linuxevent] for
> Of course I want to be an alpha-tester :) - but I tried it and it
> didn't work. If I press a key, it is detected, but not which key ...
> (I tried it with the hid version from your hp)
> I also tried [linuxevent] and there is the same problem.
[linuxevent] is quite a simple object, it just dumps data from the
/dev/input/event? device to Pd land. Are you sure you are getting data
from the device? You can "cat /dev/input/event0" and then try the
>> IIRC, the keyboard keys are not yet fully mapped with the [hid]
>> object. Its not the most exciting project, it basically involves
>> writing a lookup table to translate Linux input key types to [hid]
>> key types.
> If you give me a hint how I shouldcan make it I would do it ...
In the Pd CVS, you'll need to work on the file
externals/hcs/hid/hid_linux.c. The events are gotten by the while loop
in hid_get_events(); You'll need to implement a function that does a
table lookup using the event code define(i.e. KEY_A) and translates it
to a lowercase string/symbol name "key_a". This table should be
auto-generated from /usr/include/linux/input.h. I think the table
should include all KEY_? types there (KEY_ESC -> KEY_MEDIA).
I didn't create a separate build system, use the externals build system
It would be awesome if you got this working!
"Computer science is no more related to the computer than astronomy is
related to the telescope."
More information about the Pd-list