PFN_KEYBD_DRIVER_MAP_VIRTUAL_KEY (Windows CE 5.0)

Send Feedback

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.

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 uCode parameter.

    The following table shows the possible translations.

    Value Description
    0 uCode is 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 uCode is 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 uCode is 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 uCode is 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 Values

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

OS Versions: Windows CE .NET 4.0 and later.
Header: Keybddr.h.
Link Library: LayoutManager.lib.

See Also

MapVirtualKey

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.