CTerminalEmulator::GetMappedKey Method  
 
BOOL GetMappedKey(
  UINT nMappedKey,  
  LPTSTR lpszKeyBuffer,  
  UINT cchKeyBuffer  
);
BOOL GetMappedKey(
  UINT nMappedKey,  
  CString& strKeyBuffer  
);

The GetMappedKey method returns the escape sequence mapped to the specified key.

Parameters

nMappedKey
The key which is an index into the display key mapping table. This defines the values returned by special (method) keys for the current emulation.
lpszKeyBuffer
Address of the buffer which will receive the escape sequence mapped to the specified key. This argument may also be a CString object which will contain the mapped key string when the method returns.
cchKeyBuffer
The maximum number of characters that may be copied into the key buffer string, including the terminating null character.

Return Value

If the method 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 method will return zero.

Remarks

The GetMappedKey method returns the escape sequence that has been mapped to a special key. This method 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 server when the user presses the F1 method key). If a sequence has not been explicitly mapped through a call to SetMappedKey, 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 server. 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 TranslateMappedKey method, so it is recommended that it be used when mapping a virtual keypress to the appropriate escape sequence.

Requirements

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

See Also