Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
Windows Mobile Supported Windows Embedded CE Supported
4/14/2010

The function based on this prototype implements the functionality of MapVirtualKey. It is called by MapVirtualKey, which translates, or maps, a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code.

Syntax

typedef UINT32 (*PFN_KEYBD_DRIVER_MAP_VIRTUAL_KEY)(
  UINT32 
uCode,
  UINT32 
uMapType
);

Parameters

uCode

[in] Virtual-key code or scan code for a key.

uMapType

[in] Translation to perform. The value of this parameter depends on the value of the uCodeparameter.

The following table shows the possible translations.

Value Description

0

uCodeis a virtual-key code that is translated into a scan code. If it is a virtual-key code that does not distinguish between left-hand and right-hand keys, the left-hand scan code is returned. If there is no translation, the function returns zero.

1

uCodeis a scan code that is translated into a virtual-key code that does not distinguish between left-hand and right-hand keys. If there is no translation, the function returns zero.

2

uCodeis a virtual-key code that is translated into an unshifted character value in the low-order word of the return value. Dead keys, or diacritics, are indicated by setting the top bit of the return value. If there is no translation, the function returns zero.

3

uCodeis a scan code that is translated into a virtual-key code that distinguishes between left-hand and right-hand keys. If there is no translation, the function returns zero.

Return Value

A character value indicates success. Zero indicates that there is no translation.

Remarks

Cases 0 and 2 have to do with converting virtual-key codes to Unicode characters or scan codes. Therefore, they use the input language. Cases 1 and 3 convert a scan code to a virtual-key code. As such, they use the current device layout for the first platform dependent driver (PDD) in Layout Manager. Remote Desktop Protocol (RDP) uses translation 0 to convert virtual-key codes to XT scan codes. The human interface device (HID) keyboard driver uses translation 3 to convert AT scan codes to virtual-key codes.

Requirements

Header keybddr.h
Library layoutmanager.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Other Resources

MapVirtualKey