I found the guts of this thing. Here is where it intercepts the keyboard codes and substitutes a CTRL scancode for a CAPSLOCK scancode. I'm unsure of how to get communications established between the SYS driver and a Girder Plugin to do the rest.
I was, on another note, able to successfully build the driver.
Code:
// Ctrl2cap.c -- line 402 *snip!*
if( NT_SUCCESS( Irp->IoStatus.Status ) ) {
//
// Do caps-lock down and caps-lock up. Note that
// just frobbing the MakeCode handles both the up-key
// and down-key cases since the up/down information is specified
// seperately in the Flags field of the keyboard input data
// (0 means key-down, 1 means key-up).
//
KeyData = Irp->AssociatedIrp.SystemBuffer;
numKeys = (int) (Irp->IoStatus.Information / sizeof(KEYBOARD_INPUT_DATA));
for( i = 0; i < numKeys; i++ ) {
DbgPrint(("ScanCode: %x ", KeyData[i].MakeCode ));
DbgPrint(("%s\n", KeyData[i].Flags ? "Up" : "Down" ));
if( KeyData[i].MakeCode == CAPS_LOCK) {
KeyData[i].MakeCode = LCONTROL;
}
}
}