Click here to Skip to main content
15,041,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello all,

i need to intercept input from connected mouse and kb (can be 1 set or more than 1)
aside from that i need to know where the input came from and be able to block then whenever i want to.
i am implementing a kbfiltr since hook and raw input does not work in my design.

using the kbfiltr sample source code of wddk, i can block input being sent to the OS.
the problem is i need to send this input to an application, does anone know how i can do that?


For such purposes you need to use Hooks. Start from here:[^].

If you need to intercept some System-wide event it has to be a global Hook. You can only use it if you create a separate DLL installing the Hook in the global Hook Chain.


I'm pretty much sure a Hook can block any key input and break a hook chain. At the moment I have no idea how can you get any data identifying a particular HID so you could tell one from another; I'm not sure this information is available.

The only thing I can think of is developing custom drivers for your HIDs using DDK.

micard 25-Apr-11 23:37pm
hooks will not work since i need to know wehre the input is coming from
*note that i have multiple HIDs
Yes, more than one keyboard and mouse it tricky. This problem was discussed before; to best of my knowledge, identification if a HID was not resolved.
May I ask you why identification if a HID is impossible (I mean telling keyboard 0 from keyboard 2, etc.)?
...Oh, I think the reason is "I can block input...", right?
micard 28-Apr-11 10:06am
yes, i need to block input of some HIDs and be able to receive inputs of other HIDs.

I now have an idea, since the kbfiltr can get handle of the device on filter driver, I just need to send inputs from the filter driver to the application directly. Once the KEYBOARD_INPUT_DATA is sent to the application, I just update the MakeCode of the filter driver to zero, so that no input is reflected to the OS.
The problem is the sending of the input from the filter driver to the application. Do you know how I can send input from kbfiltr driver to an application?

By the way I am using the kbfiltr sample code of WinDDK. I am capturing the input from the KBService callback.

Sergey Alexandrovich Kryukov 28-Apr-11 12:28pm
I know. I updated my answer, please see after [EDIT]. Not that I can help to identify HID. I don't see an easy solutions. As I can see from your previous Questions, this is your main problem. I did not see any other solutions (you did not get anything, right?). Maybe designers of the system never thought about such exotic feature. I never heard of anyone who would want such unusual thing; you're the only one I know :-)
Already done:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900