如何处理在C Linux控制台pssed键$ P $? [英] How to handle key pressed in a Linux console in C?

查看:208
本文介绍了如何处理在C Linux控制台pssed键$ P $?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Linux控制台,我愿做一个程序,它输出随机字符,直到ESC是pressed。我怎么能做出这样的键盘处理?

I'm using Linux console and I would like to do a program which outputs random characters until ESC is pressed. How can I make such a keyboard handler?

推荐答案

残培()的调用库也许?此外,您将需要使用notimeout()来告诉残培()不等待下一个关键preSS。

getch() from Curses library perhaps? Also, you will need to use notimeout() to tell getch() not to wait for next keypress.

这篇关于如何处理在C Linux控制台pssed键$ P $?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆