Ncurses 多键输入

发布于 2024-10-05 12:01:09 字数 152 浏览 0 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贱贱哒 2024-10-12 12:01:09

没有 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文