disable typeahead / input queue w/ ncurses



I'm writing an ncurses application, and disabling the typeahead buffer
or input queue or whatever does not seem as straight forward as it
could be, after reading through the man pages I've been unable to come
up with the desired solution...

e.g.
while(1){
z=getch();
printf("char: %d ", (int) z);
sleep(5);
}

if they type faster than one character every five seconds, it should
not keep going without input, i dont want input to the getch() call
being supplied from some wacky buffer or anything, i want the input for
each call to come directly from the keyboard. I have found that I can
call flushinp() before each call to getch(), but is this the best way?
the only way?

Thanks.

.