I am working on a networked system (in C#) where on one computer I receive keyboard input via a low level hook and then transmit the input to another computer where it has to be injected.
The hook delivers the keyboard input in a KeyEventArgs class. To inject it into the target computer I need to use a KEYBDINPUT struct with SendInput.
There does not seem to be an easy match between KeyEventArgs.KeyCode or KeyValue and KEYBDINPUT.wVk and wScan. I also tried MapVirtualKey in some combinations.
Alternatively, I could convert KeyEventArgs into windows key messages (WM_KEYUP/DOWN with wParam and lParam) on the source computer but I am facing similar difficulties.
Can anybody here help out with either scenario?