NvtSetMappedKey Function  
 
BOOL WINAPI NvtSetMappedKey(
  HDISPLAY hDisplay,  
  UINT nMappedKey,  
  LPCTSTR lpszKeyBuffer  
);

The NvtSetMappedKey function maps an escape sequence to the specified key.

Parameters

hDisplay
Handle to the virtual display.
nMappedKey
The key which is an index into the display key mapping table. This defines the values returned by special (function) keys for the current emulation.
lpszKeyBuffer
Pointer to a string which defines the sequence of characters that are to be mapped to the specified key. Passing an empty string or NULL pointer will delete the current sequence mapped to the key and restore the default value, if one has been defined.

Return Value

If the function succeeds, the return value is non-zero and the escape sequence is mapped to the specified key. If the key value is invalid or could not be mapped, then the function will return zero.

Remarks

The NvtSetMappedKey function maps an escape sequence to a special key. This function can be used to specify what sequence of characters should be sent in response to a keypress (for example, what sequence should be sent to a server when the user presses the F1 function key). There are a number of default sequences that are mapped to the function and cursor keys, based on the current emulation. Calling this function will override the default sequence for a key, if one has been defined.

The following special keys are defined:

Value Constant Description
0 NVT_F1 F1 function key
1 NVT_F2 F2 function key
2 NVT_F3 F3 function key
3 NVT_F4 F4 function key
4 NVT_F5 F5 function key
5 NVT_F6 F6 function key
6 NVT_F7 F7 function key
7 NVT_F8 F8 function key
8 NVT_F9 F9 function key
9 NVT_F10 F10 function key
10 NVT_F11 F11 function key
11 NVT_F12 F12 function key
12 NVT_SF1 Shift F1 function key
13 NVT_SF2 Shift F2 function key
14 NVT_SF3 Shift F3 function key
15 NVT_SF4 Shift F4 function key
16 NVT_SF5 Shift F5 function key
17 NVT_SF6 Shift F6 function key
18 NVT_SF7 Shift F7 function key
19 NVT_SF8 Shift F8 function key
20 NVT_SF9 Shift F9 function key
21 NVT_SF10 Shift F10 function key
22 NVT_SF11 Shift F11 function key
23 NVT_SF12 Shift F12 function key
24 NVT_ENTER Enter key
25 NVT_ERASE Backspace key
Value Constant Description
26 NVT_UP Cursor up key
27 NVT_DOWN Cursor down key
28 NVT_LEFT Cursor left key
29 NVT_RIGHT Cursor right key
30 NVT_INSERT Insert key
31 NVT_DELETE Delete key
32 NVT_HOME Home key
33 NVT_END End key
34 NVT_PGUP Page up key
35 NVT_PGDN Page down key
36 NVT_APPUP Up arrow key
37 NVT_APPDOWN Down arrow key
38 NVT_APPLEFT Left arrow key
39 NVT_APPRIGHT Right arrow key
40 NVT_APPENTER Keypad enter key
41 NVT_KEYPAD0 Numeric keypad 0
42 NVT_KEYPAD1 Numeric keypad 1
43 NVT_KEYPAD2 Numeric keypad 2
44 NVT_KEYPAD3 Numeric keypad 3
45 NVT_KEYPAD4 Numeric keypad 4
46 NVT_KEYPAD5 Numeric keypad 5
47 NVT_KEYPAD6 Numeric keypad 6
48 NVT_KEYPAD7 Numeric keypad 7
49 NVT_KEYPAD8 Numeric keypad 8
50 NVT_KEYPAD9 Numeric keypad 9

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csnvtv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

NvtGetDisplayMode, NvtGetMappedKey, NvtResetMappedKeys, NvtSetDisplayMode, NvtTranslateMappedKey