Share via


KEYMAPPING

4/8/2010

The KEYMAPPING struct is used to indicate which physical keys correspond to which characters. It is used in conjunction with LoadKeyMap to set the key mapping data which applies to an external keyboard or device.

Syntax

typedef struct _KEYMAPPING {
  WCHAR chHardware;
  WCHAR *rgchMatches;
} KEYMAPPING, *PKEYMAPPING;

Parameters

  • chHardware
    [in] WM_CHAR value sent when the affected key is pressed without using Shift or other modifiers.
  • rgchMatches
    An array of WM_CHAR values that should match chHardware.

    rgchMatches must be '\0' terminated.

Remarks

When passing multiple KEYMAPPING values to LoadKeyMap, each of the chHardware values must be unique across the entire set. The rgchMatches values must also be unique across the KEYMAPPING set.

All of the chHardware and rgchMatches values must be lowercase or caseless.

There are three Mapping Types:

  1. Mapping a character to its base character.
    For example, the character 'A' should map to any variant of 'A', such as 'Ã'. This behavior is controlled by the operating system's CompareString and LCMapString APIs and is not customizable.
  2. Mapping a key to one of the dialing values: 0-9,*,#, or +.
    For example, on a 30–key device, in which the dialing digits share a key with another character, pressing the E2 key might cause the keyboard driver to send a VK_E message. Since the user sees "E2" on the key, the user should see a '2' appear in the dialing accumulator. OEMs and IHVs can customize this type of mapping.
  3. Mapping a key to multiple values.
    For example, on a 15–key device, pressing the ?AS key might cause the keyboard driver to send a VK_A message. Since the user sees "?AS" on the key, the user should see anything that starts with '?', 'A', or 'S' as a match, including anything that maps to '?', 'A', or 'S' via mapping a character to its base character. OEMs and IHVs can customize this type of mapping.

A complete example of how to form, load, and unload 12–key, 15–key and 30–key KEYMAPPINGS is available at <Adaptation Kit>\Public\SDK\Samples\Common\CPP\Win32\LoadKeyMap\.

Requirements

Header aygshell.h
Library aygshell.lib
Windows Mobile Windows Mobile 6 Classic and later, Windows Mobile 6 Professional and later, Windows Mobile 6 Standard and later

See Also

Reference

LoadKeyMap
UnloadKeyMap
Keyboard Reference

Other Resources