I am currently using read(0, &c, 1)
to read a single character from stdin however the character does not appear to be processed until I either hit enter or ^D. What is a good way to read a keystroke and store it?
I have tried fcntl(0, F_SETFL, fcntl(0, F_GETFL) | O_NONBLOCK)
but the characters still require an enter or ^D to be processed.