[chuck-users] KBHit events
Julien Saint-Martin
julien.saintmartin at googlemail.com
Thu Dec 26 09:16:59 EST 2013
HI Manuel,
I have no more idea unfortunately. Maybe you can try with Hid events
http://chuck.cs.princeton.edu/doc/examples/hid/kb.ck
Br,
Julien
Le dimanche 22 décembre 2013, Manuel Bärenz a écrit :
> 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:
>
> 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.
>
> On my side I tested your code replacing 5 by 0 in the line:
> if(!hid.openKeyboard(0)) me.exit();
>
> It works for me. Can you try the same thing? Maybe argument of
> openKeyboard is not related to the event number in your system.
>
> Cheers,
> Julien
>
>
>
>
> 2013/12/22 Manuel Bärenz <manuel at 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:
>
> Hi Manuel and Moisés,
>
> Sorry for confusion I checked my code and I use Hid event not KBHit.
>
> I work on linux too (Debian). And I have to modify a little my linux
> config to use KeyBoard in Chuck.
> On linux distrubutions I tried, Chuck didn't receives Kb event by
> default. But fortunately there is a work around.
> I am not on my linux PC now so maybe the following is not exactly right:
> Go to directory /dev/input and find which event corresponds to your
> keyboard (there is a directory with links name of
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20131226/1563916f/attachment-0001.html>
More information about the chuck-users
mailing list