NvtGetMappedKey
BOOL NvtGetMappedKey(
HDISPLAY hDisplay,  
UINT nMappedKey,  
LPTSTR lpszKeyBuffer,  
UINT cchKeyBuffer  
);

The NvtGetMappedKey function returns the escape sequence mapped 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
Address of the buffer which will receive the escape sequence mapped to the specified key.
cchKeyBuffer
The maximum number of characters that may be copied into the key buffer string, including the terminating null byte.

Return Value

If the function succeeds, the return value is non-zero and the escape sequence for the mapped key is copied into the specified buffer. If the key has not been mapped, and there is no default escape sequence defined, then the function will return zero.

Remarks

The NvtGetMappedKey function returns the escape sequence that has been mapped to a special key. This function can be used to determine what sequence of characters should be sent in response to a keypress (for example, what sequence should be sent to a remote host when the user presses the F1 function key). If a sequence has not been explicitly mapped through a call to NvtSetMappedKey, the default sequence for the current emulation will be returned.

Note that the current display mode, such as whether or not the emulator is in application mode or not, should be considered when determining which mapped key to use. For example, if the emulator is not in application mode and the user presses the up-arrow key, the sequence mapped to the NVT_UP key should be sent to the remote host. However, if the emulator is in application mode, the sequence mapped to the NVT_APPUP key should be sent instead. This is automatically handled by the NvtTranslateMappedKey function, so it is recommended that it be used when mapping a virtual keypress to the appropriate escape sequence.

Requirements

Client: Requires Windows Vista, Windows XP or Windows 2000 Professional.
Server: Requires Windows Server 2008, Windows Server 2003 or Windows 2000 Server.
Header: Include cstools6.h.
Library: Use csnvtav6.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

NvtGetDisplayMode, NvtResetMappedKeys, NvtSetDisplayMode, NvtSetMappedKey, NvtTranslateMappedKey


Copyright © 2008 Catalyst Development Corporation. All rights reserved.