Altera_Forum
Honored Contributor
20 years agoKey pressed?
Hello! How can I check if a key was pressed? I didn't found a appropriate function in the C which is used by Microtronix. Bye, Lothar.
Hi Lothar,
> fgetc() is not a solution for me, because I only have to check if key was > pressed or not. Okay ... I'll take a giant step into the abstract ;-) and just assume you're referring to a serial device, consonle, pty, etc. rather than some sort of custom keypad or custom hardware: You can use the select() system call with an appropriate timeout. If you just want to poll, set the timeout to zero. Regards, --Scott