Re: kbhit
Oliver J. Enders wrote:
> Hi Mike,
>
> Just wanted to let you know. You are awesome! Thanks for having your
> kbhit program on the web (in response to someone elses question two
> years ago). It sure made my day. I've been trying to figure out how to
> read in characters under Linux.
...
I can't take any credit. In fact, I probably should've given more
pointers (which is why I'm taking this opportunity to CC the list I
originally posted to). If you have a chance, check out the book
"Beginning Linux Programming" by Neil Matthew and Richard Stones. It's
Wrox Press, ISBN 1-874416-68-0 (1st ed) ISBN 1-861002-97-1 (2nd ed).
You'll find many great pointers for developing on Linux, including the
original version of the code I parapharsed for the list. The book is
an *excellent* introduction to linux programming, and I've used it
many times.
I'm glad the code was useful. But thank Unix and Neil and Rick. :)
Ideally, we'd like to see if you can write your app so that it doesn't
use kbhit to busy-wait on an event. E.g., use Cbreak mode in curses
instead, or simply use tcgetattr and tcsetattr with appropriate
settings. It's not too bad with a good book (or man page for that
matter). :)
The code is GPL'd by Wrox press btw.
Happy coding.
--
Mike Brownlow http://www.wsmake.org/~mike/
-----------------------------------------------------------------
1024D/8AA6EAFD 3861 96B3 EEA2 285C BE23 F706 3E1E EBB2 8AA6 EAFD
"Hatred stirreth up strifes: but love covereth all sins." Pr10:12
Reply to: