Re: Linux: Unbuffered reading from stdin
- From: Markus Mayer <contact.me.via.my.website@xxxxxxx>
- Date: Mon, 22 Oct 2007 14:15:48 +0200
Am 22.10.2007 13:24 postulierte Markus Mayer folgendes:
[...]
2) What happens when the user presses just ESC? Sounds easy to me, just
check if there are no more chars in stdin - but how do you do that? By
just read()ing STDIN_FILENO after an ESC the terminal is blocked until
another key is pressed - that is not really what I want.
D'oh ... that was a dumb one. By reading a maximum of n bytes into the
buffer I can check bytes 2..n if buffer[0] is 27. Okay - done.
Are there other solutions though?
Regards,
Markus
.
- References:
- Linux: Unbuffered reading from stdin
- From: Markus Mayer
- Linux: Unbuffered reading from stdin
- Prev by Date: Force printf format?
- Next by Date: Re: lcc-win32 and GNU
- Previous by thread: Re: Linux: Unbuffered reading from stdin
- Next by thread: Re: Linux: Unbuffered reading from stdin
- Index(es):