Reading from the keyboard
Hello,
I have the following segment of code:
while(1) {
read(0, &c, 1);
if (c >= 0x20) printf("key = %c\n", c);
fflush(0);
}
The problem is that the keys pressed don't appear until 'Enter' key is hit.
I would like reading from the keyboard immediately.
How do I fix it?
Thanks in advance
|