Question:
What kind of resources are needed to learn how to create one\'s own Input/Output system?
My Own Understanding:
<
What follows is only related to processing input on Windows.
As mentioned by capr in the comment to Dietrich Epp's answer, VK_ codes change based on the language of the keyboard layout you're using. So if your keyboard layout is french and you press 'Q' on your QWERTY-keyboard, the virtual key for 'A' is produced. If your layout is e.g. en-US, the virtual key for 'Q' is produced, as expected.
Since actual scan codes are hardware dependent (and thus not usable), I cirumvented this problem of layout dependence by translating the generated scan code to a virtual key corresponding to the en-US keyboard layout. This can then be translated to the USB HID codes in the manner Dietrich Epp described. This produces the same expected USB HID code regardless of the language of the layout.
The way to translate scan code to VK of en-US,
// Get and store the name of the currently used locale
wchar_t defaultLayoutName[KL_NAMELENGTH];
GetKeyboardLayoutName(defaultLayoutName)
// Load and store a handle to the locale for en-US ("00000409")
HKL defaultEnUSInputLocale = LoadKeyboardLayout(TEXT("00000409"), KLF_NOTELLSHELL);
// Load the locale that was in use before so as not to change the keyboard layout of the user
LoadKeyboardLayout(defaultLayoutName, KLF_ACTIVATE);
--- (at windowProc) ---
case WM_INPUT:
// Use the handle to the en-US locale to translate the scan codes to VK_.
virtualKey = MapVirtualKeyExW(scanCode, MAPVK_VSC_TO_VK_EX, defaultEnUSInputLocale);
// translate virtualKey to USB HID by using e.g. the codes supplied by Dietrich Epp
int8_t usbHIDkey = VK_TO_HID[virtualKey];
Note that there are some additional hurdles related to virtual keys on Windows. I found this site to be of excellent help with the matter: https://blog.molecular-matters.com/2011/09/05/properly-handling-keyboard-input/