[chuck-users] bug in HidMsg?

Spencer Salazar ssalazar at CS.Princeton.EDU
Sun Nov 4 00:23:52 EDT 2007


Hi Atte,
Thanks for finding this!  Seems to be a bug--I directly transcribed  
the USB HID usage tables for each key's keycode, so its easy to see  
how I could have mixed that up.

A fix is in CVS (only change is in util_hid.cpp).

spencer

On Nov 1, 2007, at 12:54 PM, Atte André Jensen wrote:

> Hi
>
> I think something is not working correct in HidMsg. Running the
> following code and pressing "5" prints "34" but pressing "s" also  
> prints
> "34" (this is with a danish keyboard, things might look different with
> other keyboards, I know). Shouldn't each key be associated with a  
> unique
> int?
>
>
> 1 => int device;
> Hid hi;
> HidMsg msg;
> if( !hi.openKeyboard( device ) ) me.exit();
> <<< "keyboard '" + hi.name() + "' ready", "" >>>;
> while(true){
>     hi => now;
>     while(hi.recv(msg)){
>         <<<msg.key>>>;
>     }
> }
> -- 
> peace, love & harmony
> Atte
>
> http://atte.dk       | http://myspace.com/attejensen
> http://anagrammer.dk | http://modlys.dk
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users



More information about the chuck-users mailing list