int MapVirtualKey(
WORD wCode,
WORD wMapType
);
Maps scan codes to virtual-key codes, and virtual-key codes to either scan codes or ANSI character. This function is intended to be used by the Program Information File (PIF) Editor and Windows to get information about keyboard mapping.
Value | Meaning |
---|---|
0 | Map virtual key to scan code. |
1 | Map scan code to virtual key. |
2 | Map virtual key to ASCII character. |
The export ordinal for this function is 131.
For the first two mappings, the scan code to virtual-key code translation table is examined to determine the translations. Some valid codes may not be translated in this table.
For the third type of mapping, uppercase letters A through Z are returned for VK_A through VK_Z. ASCII characters are returned for the top-row numeric keys VK_0 through VK_9. For punctuation and dead keys in the main part of the keyboard, the unshifted character will be returned.
New keyboard drivers should support both MapVirtualKey and MapVirtualKeyEx. To support MapVirtualKey, call MapVirtualKeyEx with the lcid parameter set to the system locale id.
AnsiToOem, OemToAnsi, MapVirtualKeyEx