Share via


LoadKeyMap

4/8/2010

In order to use an external keyboard, it is essestial to know which keys map to which characters. This function sets a new keyboard mapping.

Syntax

HANDLE LoadKeyMap(
    PKEYMAPPING prgKeyMaps,
    DWORD cKeyMaps
);

Parameters

  • prgKeyMaps
    [in opt] Pointer to an array of KEYMAPPINGs to load.
  • cKeyMaps
    [in] The number of the KEYMAPPINGs to load.

Return Value

This function returns a handle to a KeyMap identifier. This should be saved for later use with UnloadKeyMap. If there is an error, it will return INVALID_HANDLE_VALUE.

Remarks

For an unambiguous keyboard, set prgKeyMaps to null to deactivate the base key mapping. Fully unambiguous keyboards should do this since there’s no need to have any of their keys map to any other values.

The default mapping data can be restored by calling UnloadKeyMap and passing the return value of this function. Regardless, the default mapping data will be restored on reboot.

If or when the device for this mapping data is disconnected, always call UnloadKeyMapping.

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

UnloadKeyMap
Keyboard Reference

Other Resources