There's a variety of issues to think about here. And, a fair bit of it is OS dependent. That said, for the unix console interface:
1) There's read exactly one character (waiting for the next character to appear, if necessary - blocking read), and there's reading up to one character (reading an empty string if no character is yet available - nonblocking read). There's also the possibility of a "one time" non-blocking read, where after a single empty read the next attempt blocks (I think I have seen this occur in some cases on linux, though I do not remember the exact details for obtaining this behavior).
2) On unix/linux, input is buffered at the c library level, but non-blocking reads can only happen at the kernel level. If non-blocking reads are supported, it would be important (for consistency) to drain that buffer before performing any non-blocking reads.
3) the default behavior for reading from the keyboard is buffered - line-at-a-time. If you want character-at-a-time unbuffered input, I am pretty sure that you need to use the kernel's read() interface. It might also be important to use fcntl() to put the input stream into the right mode.
By the way, there's two different buffering modes for fread() - for the keyboard, the default behavior is line-at-a-time (for files, it's block-at-a-time). To empty the buffer you could read a character at a time until a newline character is read, probably using getchar(). (It would be nice if getchar() could be used in an unbuffered mode, but there's no portable way of doing that.) I do not know if there's a portable way of draining the input buffer when it's in a block-at-a-time mode.
--------------------------------------------------------------------
Anyways, it's going to be important to define the scope of this mechanism and what will happen when line-at-a-time reads are mixed with character-at-a-time reads.
--------------------------------------------------------------------
I imagine qt has some similarities, but I also imagine that it's more about event handlers than an input stream. (And, JHS would have a similar architecture.)
I hope some of this is relevant,
--
Raul