The keybd_event API function is designed to programmatically simulate the pressing of a key on the keyboard. It has a parameter for a virtual key code (the value assigned to a key by the Windows OS) and parameter for a keyboard scan code (the value that the physical keyboard hardware sends to the computer). Why does it need both of these values to operate? Shouldn't either one or the other be sufficient to specify which key press I want to simulate? How does this API function actually use these 2 values internally? What if the virtual keycode specified is the keycode for one key, but scan code specified in the scan code parameter is the scan code for a different key? How does the function know which key it should be trying to simulate the press or release of? How does it resolve this conflict?
↧