程序读取按键值 [英] program to read key press values

查看:40
本文介绍了程序读取按键值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你可以指导我如何编写这个程序



我的程序应该输出如下


当我按下键盘上的键应该返回键被按下


并且如果键被按下超过350ms它应该返回键是保持

can u guide me how to write this program


my program should give outputas follows

when i press a key on the keyboard it should return the "key is pressed"

and also if the key is pressed more than 350ms it should return the "key is hold"

推荐答案

kbhit()是一个函数,只要按下键就会返回整数值...

你可以使用上面的函数.....


试着发布你写的代码...
kbhit() is a function returns integer value whenever the key is pressed...
you can use the above function.....

Try to post the code you had written...


ok


i尝试了相同的

但是如何在保持键事件上执行350 ms的时间间隔
ok

i tried the same
but how to do the 350 ms time gap on hold key event


请以明确的方式解释您想要的代码....
Please explain the code you want in clear....

这篇关于程序读取按键值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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