How exactly does Ncurses capture input into the console? I would like to implement it myself instead of using ncurses due to the overhead that ncurses is causing.
Thanks!
How exactly does Ncurses capture input into the console? I would like to implement it myself instead of using ncurses due to the overhead that ncurses is causing.
Thanks!
Very short and basically: It might use the TTY
ioctl
calls to get and set flags needed for the different modes. Then it could simply useread
to read characters in a blocking or non-blocking manner.Special keys (like the function keys for example) are read using multiple characters which are parsed.