[chuck-users] KBHit and arrow keys

Adam Tindale adamtindale at hotmail.com
Fri Apr 28 22:57:11 EDT 2006


Hey,

Thanks for your discussion about this. Please post your findings on  
the wiki. I would be more than happy to merge this into the manual.  
If you have some LaTeX skills you could also do it yourself and send  
me a patch.

Nice work.

--art


On 28-Apr-06, at 4:14 PM, Kassen wrote:

> Jim Hinds;
>
>> This isn't unique to the keyboard, but is pretty much the way all  
>> interrupt
>> driven I/O works.  So, be happy: what you thought were warts in  
>> your program
>> were really elegant solutions to a universal problem.  Or  
>> something like
>> that.
>
> Ah, yes, I did some more testing and now it's clear. Thanks.
>
> I was under the impression that "kb.getchar()" would be updated every
> iteration of the "while" loop and that the top value would be cleared
> at that time and instead calling it already clears it from the buffer
> so you need to be carefull how you do that or it'll be gone forever.
>
> I didn't expect this to work;
> if ( ( kb.getchar() == 224) && ( kb.getchar() == 72) ) <<<"up">>>;
> But it does.
>
> Considdering what you wrote that's all very understandable, realy, but
> in that case it might be nice if something along the lines of the
> example I posted previously would be in the documentation somewhere
> because that's a bit tricky and this stuff covers almost half the
> keyboard.
>
> So, should I add it to the Wiki? If so, what would be a apropriate  
> place?
>
> Thanks again for your the explanation,
>
> Yours,
> Kas.
> _______________________________________________
> 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