>Hi all, > I want to get the character while I strike any key,I try to use > >getchar(),but it need to strike ENTER to end of string,can I get the >value of key >immediately before I strike ENTER.In DOS,I can use kbhit() to >check if there is >any key to be striked,but how can I do in linux? > I have no idea how to get the key. Do you have any idea? > >Thanks! > >Michael You should 'open' /dev/tty# (remenber not to include NOCCTY) then you can work with the terminal in the way you want. For instance you can use 'select' to check if there is any data avalaible, or work in asynchronous mode using signals (it's more dificult but for RT it more suitable).Anyway you should take a look to the 'Advaced programming in Unix' by Stevens, it has a chapter of terminal very useful, the serial-programming Howto it very useful too. _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/rtlinux/
