Hello, folks -
I’m starting a new project, which will attempt to inject keystrokes (originating from user-mode code) via a device driver.
My first thought was to actually create a keyboard device driver, bypassing the class driver due to KMDF’s general lack of support for minidrivers. However, I couldn’t get the minimal driver to install (DiFx/devcon hangs after “DiFx Info: ENTER UpdateDriverForPlugAndPlayDevices…”; the driver is started and a device added but nothing after that; the device is of type FILE_DEVICE_KEYBOARD and exposes GUID_DEVINTERFACE_KEYBOARD - not sure what else I’m expected to do…).
So I decided to take a step back; writing a keyboard driver (as opposed to a minidriver) may be possible but it’s certainly not common. I can think of two other ways to do this:
- Take the hidusbfx2 route (I just downloaded the 6001 R0 WDK just for this sample): make a minimal WDM minidriver with a KMDF filter on it.
- Take the kbfiltr route: just a KMDF filter without a seperate software-only keyboard device. This should be sufficient to inject keystrokes, but I am not sure if the sample provided can be made to work for *any* type of system. (I have a computer at home that only has a USB keyboard, no PS2).
Plus, for either of these solutions, I believe I’d need an additional control device as well, for user-mode communication, correct?
I’d love to hear recommendations on which approach I should use. FYI, I have some KMDF experience but no WDM; PnP for WDM scares me…
-Steve