Context: I have a pro micro as a marcopad/keyboard controller and I want to be able to 'program' the keys.
This means I press a controll button and the pro micro starts to 'record' anything my default windows keyboard writes. On the second press it saves the keystrokes and writes them when I use my macro keyboard.
It comes down to:
Is there any standard to 'read' the windows keyboard as a HID device?
I already figured this may not be possible, but maybe I've missed something.
I don't know if it's possible (I have some doubts). I only know a workaround. Write a small PC application that reads keyboard input and sends it to the ProMicro over Serial.
When you click the "control" key, you can tell the PC to start the application amd you can start typing.
Big thanks to the USB developers that this isn't possible, it would be an even bigger security nightmare than USB is already, at least on standard operating systems.
The only way to achieve that is to connect the keyboard to an Arduino which offers USB host functionality and USB slave functionality and forward all keystroke from the keyboard to the PC.
sterretje is pointing in the right direction but I wouldn't send the keystrokes to the Arduino but simply use the Arduino to trigger the recording/playback in the application (you can use non-standard keycodes for that).