User32VkKeyScan Method

Note: This API is now obsolete.
Translates a character to the corresponding virtual-key code and shift state for the current keyboard.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
[ObsoleteAttribute("This function has been superseded by the VkKeyScanEx function. You can still use VkKeyScan, however, if you do not need to specify a keyboard layout.", 
	false)]
public static short VkKeyScan(
	char character
)

Parameters

character  Char
The character to be translated into a virtual-key code.

Return Value

Int16
If the function succeeds, the low-order byte of the return value contains the virtual-key code, and the high-order byte contains the shift state.

If the function finds no key that translates to the passed character code, both the low-order and high-order bytes contain –1.

Remarks

See Also