[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
kbhit() function (uses termios)
- Date: Fri, 05 Sep 2008 13:44:42 -0400
- From: gds at chartertn.net (Gene Smith)
- Subject: kbhit() function (uses termios)
The code I am trying to port to rtems uses kbhit() function (you hit a
key with no echo and no ENTER/RETURN) to cause an action based on the
key pressed. Although I am not a big fan of having important things
happen based on an unconfirmed key press, it does not seem to work for
me in rtems. kbhit always returns 0 even after I press a key.
The 3rd party code is copied from here:
http://www.flipcode.com/archives/_kbhit_for_Linux.shtml
but with the addition of a flag to turn off echo:
term.c_lflag &= ~ECHO;
Is there a reason this might not work in rtems? It works ok in linux.
Thanks,
-gene