c - Linux 模拟 Windows GetAsyncKeyState()

标签 c linux fedora keyboard-input

是否有一些类似 Linux 的 Windows 函数 GetAsyncKeyState() ?或者可能存在一些返回的异步函数 - 键盘缓冲区是否为空?

谢谢。

最佳答案

这里的关键问题是:针对哪个抽象? X windows、ncurses 还是 stdio? Linux 不像 Windows 那样简单和单一。

对于 stdio(普通的老式 stdin/stdout 文本程序)fgetc_unlocked 可以解决问题。

关于c - Linux 模拟 Windows GetAsyncKeyState(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7645058/

相关文章:

python - Linux Fedora virtualenv 站点包位置不正确

linux - 在 Fedora 中安装虚拟 PC

c++ - C++ 中的 C 风格转换和可读性

linux - 我怎样才能知道Linux中当前附加的卷

linux - mmap(2) 与 mmap(3)

MySQL密码总是提示重置密码

c - ioremap - 无法处理虚拟地址 XXXXXXXX 处的内核分页请求

c - 在C中使用fread读取文件

c++ - 在 UDP 套接字中使用 Connect()、send()、recv 时出现问题

linux - 需要读取文件并将结果用作 shell 脚本中的命名变量