ncurses 的内部结构:控制台输入

Internals of ncurses: console input

Ncurses 究竟是如何将输入捕获到控制台的?由于 ncurses 导致的开销,我想自己实现它而不是使用 ncurses。

谢谢!

非常简短,基本上:它可能使用 the TTY ioctl calls to get and set flags needed for the different modes. Then it could simply use read 以阻塞或非阻塞方式读取字符。

特殊键(例如功能键)使用经过解析的多个字符读取。