Ncurses 多键输入
我正在使用 ncurses 用 C 创建一个基于控制台的应用程序,它接受单独的按键输入,但也读取按键组合。例如,当用户同时按下 S 键和 F 键时,我希望它运行某些功能。是否有一些类似 getch() 的函数用于多键组合?
谢谢!
I am creating a console based application in C using ncurses that takes individual key input but also reads in key combinations. For example when the user presses both the S key and the F key, I want it to run some function. Is there some function like getch() for multi-key combinations?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有 ncurses 不提供类似的东西 - ncurses 来自一个时代,输入可能只是通过串行端口作为直接连接的键盘。
如果您需要知道是否同时按下了 2 个键,您将需要访问较低级别的键盘。
No ncurses does not provide anything like that -- ncurses is from an era where input was just a likely to be over a serial port as a directly connected keyboard.
If you need know if 2 keys are pressed at the same time you will need to access the keyboard at a lower level.