This function generates the appropriate Unicode characters and shift state flags for a specified virtual key, key state array, and driver state.
UINT32 KeybdDriverVKeyToUnicode( UINT32 VirtualKey, KEY_STATE_FLAGS KeyEvent, KEY_STATE KeyState,
void *pKeybdDriverToUnicodeState, UINT32 cBufferSize,
UINT32 *pcCharacters, KEY_STATE_FLAGS *pShiftStateBuffer,
UINT32 *pCharacterBuffer );
Specifies the count of 32-bit entries in each buffer.
If KeyState is NULL, the driver must fill in the character corresponding to the unshifted state for the virtual key and return.
In all other cases, the KeybdDriverVKeyToUnicode function must update the key state array and fill in the shift state determined from the key state array and, if necessary, update the state TO_UNICODE_STATE. This means that the count of characters generated is always at least 1. See KEY_STATE_FLAGS in order to generate the shift state without a corresponding character.
Each character should have a corresponding shift state entered into the shift state buffer, even if it is the same as the preceding shift state.
Each entry in the character buffer is 32 bits, whereas a Unicode character is 16 bits. The driver assigns characters to the buffer to clear the high order 16-bits, as in the following code example.
*pCharacterBuffer = Unicode character; // YES
This function is defined in the Keybdmdd.cpp file.
KeybdDriverGetInfo, KeybdDriverInitStates