How to receive i/o "events" in C?
Hello I am looking for a way to do I/O event programming with keyboard (and possibly mouse) in C. I've looked for quite some time and I can't find a straightforward or consistent answer on the topic. Obviously there must be a contrived way at least of doing it. Or else how could other languages which were built on or compiled with C have I/O events? What I'm currently building/learning is to build a chat server and I want it so the user (or server) can press "escape" on the keyboard and kill their client or server. Or press another key for some other even I may put into the program. I am trying to expand my knowledge of C, Unix, networking, and event handling for other purposes. I want to see if there is any way of using standard C to do this if possible. And, as if I need to add more problems, this needs to be asynchronous. I can't have my program blocked (or at least not appear to be blocked to the user) polling all the time for keyboard press. So any help here would be hot! Thanks!