I wonder why the author didn't just read() in bytes from STDIN_FILENO? No need to use stuff like fget*.
Neither fget*() or read() from stdin would work because stdin is buffered.
It's possible to change the mode, but it would require calling the terminal control functions, and that'd requiring calling out to C anyway, so might as well use ncurses.