从一个USB键盘获取钥匙扣 [英] Get keyhooks from one usb keyboard
问题描述
我现在有一个有趣的硬件设置,我正在尝试通过编程来补偿它.对于那些喜欢背景信息的人.我有一部电视连接了我的计算机和在该屏幕上运行的XBMC.我也有一个模拟键盘的IR接收器 很好,除了XBMC必须是活动的应用程序,或者IR接收器将击键发送到其他地方,而我的遥控器变得无用.因此,我需要帮助的地方.
I have an interesting hardware setup right now and I'm trying to compensate for it by programming. For those who like background info. I have a tv hooked to my computer and XBMC running on that screen. I also have an IR receiver which emulates a keyboard which is great, except that XBMC must be the active application or the IR receiver sends the keystrokes elsewhere and my remote is rendered useless. So on to what I need help with.
我想从Windows视为USB键盘的IR接收器中捕获所有击键.我知道有可能从某个键盘捕获击键,因为有一个程序可以做到这一点.尽管在C#中可能无法实现.有人知道吗 该怎么做?
I want to catch all keystrokes from the IR receiver which windows sees as a usb keyboard. I know it's possible to capture keystrokes from a certain keyboard, since there is a program which does it. Though it might not be possible in C#. So does anyone know how to do this?
我已经有一些代码可以将击键发送到另一个应用程序,所以我只需要侦听特定键盘的键钩即可.
I already have some code to send keystrokes to another application, so I just need the keyhook which listens for a certain keyboard.
推荐答案
嗨pball_inuyasha,
Hi pball_inuyasha,
这是一个名为Windows挂钩演示(CSWindowsHook)的经典代码示例.它出现在其他论坛主题服务器时间.因此,该代码示例显示了如何设置Windows 钩住了VC#应用程序中的鼠标和键盘输入.
Here is a classic code sample named Windows hook demo (CSWindowsHook). It has appeared on other forum threads serveral times. Thus,the code sample shows how to set up a Windows Hook to hook mouse and keyboard inputs in a VC# application.
希望对您有帮助.
Hope it helps you.
真诚的
贾森·王(Jason Wang)
Jason Wang
这篇关于从一个USB键盘获取钥匙扣的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!