Compartilhar via


PFN_KEYBD_DRIVER_MAP_VIRTUAL_KEY (Compact 2013)

3/26/2014

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

See Also

Reference

Keyboard Driver MDD Functions

Other Resources

MapVirtualKey