the strongly recommended approach is to write this as a WDF (either KMDF or UMDF) HID miniport. your miniport will report a HID descriptor that contains a keyboard. The in box HID stack (hidclass.sys) will enumerate a child stack for the keyboard, load
the std keyboard driver (kbdhid.sys) and report the data. Basically, you write a driver one level below the keyboard stack and then you get to reuse the keyboard stack wholesale. There are a couple of samples demonstrating how to write the HID miniport,
hidusbfx2 is one of them.
d -- This posting is provided "AS IS" with no warranties, and confers no rights.