计算按下的键数 [英] count the number of keys pressed

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

问题描述

我想创建一个实用程序,即使应用程序没有获得焦点,该实用程序也可以计算应用程序中按下的键的数量,该应用程序应在后台运行,我希望在c#中进行开发
我怎么能实现这个

I want to create an utility which counts the number of keys pressed in an our even if the application has not got the focus the application should run in the background i wish to develop it in c#
how can i achieve this

推荐答案

键盘钩子就是您要寻找的答案.
为此,您必须与Windows DLL进行交互,但是在codeproject上有很多不错的文章.
试试这个全局鼠标和键盘库 [
Keyboard hooking is the answer you''re looking for.
You''ll have to interact with a Windows DLL for that, but there are plenty of good articles on it on codeproject.
Try this Global Mouse and Keyboard Library[^].
I believe it contains all you need.


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

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