简体   繁体   English

全球主要新闻听众

[英]global key press listener

Right now I try to write program to measure my programming efficienty, ex. 现在,我尝试编写程序来衡量我的编程效率,例如。 what ammount of time I spend on writing Code. 我花在编写代码上的时间是多少? To do that I need to listen to keyboard input, globaly for whole system not only window with focus. 要做到这一点,我需要听键盘输入,全球系统不仅要有焦点窗口。 Is there any way to listen globaly for key events (ex. libs), or I need to fight with kbd source? 有没有办法监听全局关键事件(例如libs),或者我需要与kbd源争夺?

Take a look at some of the existing software which does this. 看一下这样做的一些现有软件。 For example keyloggers. 例如键盘记录器。 MAybe this one would be useful: http://sourceforge.net/apps/mediawiki/pykeylogger/index.php?title=Main_Page MAybe这个有用: http : //sourceforge.net/apps/mediawiki/pykeylogger/index.php? title=Main_Page

Wouldn't the window one is currently typing in have the focus? 当前正在输入的窗口是否不会具有焦点? You're saying "not only the window in focus" but no typing will be happening with a window not in focus, yes? 你说“不仅是焦点窗口”,而且没有焦点的窗口也不会打字,是吗?

Anyways, I recently implemented a threading base approach for a Silverlight app, and used a custom StopWatch class to check the time span while typing is actually going on. 无论如何,我最近为Silverlight应用程序实现了一个线程基础方法,并使用自定义StopWatch类来检查实际进行打字时的时间跨度。 You'll have to set a default timeout period for the time between keydown and keyup events to know when one is not currently typing. 您必须为keydown和keyup事件之间的时间设置一个默认的超时时间,以了解当前何时未键入。 If interested in some code example, hit me up: 如果对某些代码示例感兴趣,请打我一下:

dwhitten15@hotmail.com dwhitten15@hotmail.com

Ciao, 再见,

David 大卫

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM