Interactive Keyboard Input
Posted on 1998-01-14
Well, I'm not sure if _Interactive Keyboard Input_ is the best title for this question (I guess all keyboard input is interactive) but I can't think of a shorter description.
Anyway, I'm a fairly new C programmer and consequentially have a beginner level book (_Teach Yourself C in 21 Days_) that has left out some, I think, important stuff. Most notably is the ability to read the last character in the keyboard buffer and not require Enter to be pressed (something similar to a command in QBasic called inkey$). All the functions the book talks about like gets() and getschar() stop program execution and wait for Enter to be pressed before continuing. I asked somebody about it and they mentioned a command they use in C++ that sounds like it has something to do with the BIOS. Can somebody please tell me how to do it in C and give me some sample code? Please note that this is for UNIX, so if it involves an operating system call it probably wont work.