I tried all numbers from 0 to 7, all the other numbers give, surprisingly, "Power Button ready" and otherwise the same results.
Am 22/12/13 13:38, schrieb Julien Saint-Martin:
JulienCheers,It works for me. Can you try the same thing? Maybe argument of openKeyboard is not related to the event number in your system.On my side I tested your code replacing 5 by 0 in the line:Hi Manuel,
You're welcome and I think you are close to success :-) "Sleep Button ready" means ChucK succeeds to open a device. But it don't looks like to be the right one.
if(!hid.openKeyboard(0)) me.exit();
2013/12/22 Manuel Bärenz <manuel@enigmage.de>
Thanks a lot Julien,
I'm still trying to set up the keyboard events. I found /dev/input/by-path/, which contains symlinks to /dev/input with sensible names. I guess this is what you meant. One of them is called "platform-i8042-serio-0-event-kbd", I assume that is the keyboard. It links to /dev/input/event5, so I granted access rights to the device to everyone and wrote the following little script:
Hid hid;
HidMsg msg;
if(!hid.openKeyboard(5)) me.exit();
<<< hid.name(), "ready">>>;
while(true)
{
hid => now;
<<< "received event" >>>;
while(hid.recv(msg))
{
<<< msg.ascii, " was used" >>>;
}
}
The output of it is, surprisingly, "Sleep Button ready", and it never comes to the point of "received event". Any ideas?
Best, Manuel
Am 06/12/13 09:57, schrieb Julien Saint-Martin:
Go to directory /dev/input and find which event corresponds to your keyboard (there is a directory with links name ofI am not on my linux PC now so maybe the following is not exactly right:On linux distrubutions I tried, Chuck didn't receives Kb event by default. But fortunately there is a work around.I work on linux too (Debian). And I have to modify a little my linux config to use KeyBoard in Chuck.Hi Manuel and Moisés,Sorry for confusion I checked my code and I use Hid event not KBHit.