KeyMapped Event  
 

The KeyMapped event is generated when a mapped key is pressed.

Syntax

Sub object_KeyMapped( [Index As Integer,] KeyIndex As Integer, Shift As Integer, KeyString As String )

Remarks

This event is generated when the user presses a special key while the emulation window has focus, and that key is mapped to a string using the KeyMap property array.

KeyIndex
An integer which specifies which mapped key was pressed, and is the same as the index value used with the KeyMap property array. Refer to the KeyMap Constants table for a list of keys and their corresponding values which may be mapped by the application. Note that the KeyIndex value is different than the key codes used by the KeyDown and KeyUp events.
Shift
An integer that corresponds to the state of the Shift, Ctrl, and Alt keys at the time the key is pressed. The Shift argument is a bit field with the least-significant bits corresponding to the Shift key (bit 0), the Ctrl key (bit 1), and the Alt key (bit 2 ). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both Ctrl and Alt keys are pressed, the value of Shift is 6.
KeyString
A string that contains the control and/or escape sequence that the key has been mapped to. This is the same value that was assigned to the KeyMap property array for this key.

Example

The following example demonstrates how to use the KeyMapped event in conjunction with the SendKey method in the Telnet control:

Private Sub Terminal1_KeyMapped(KeyIndex As Integer, Shift As Integer, KeyString As String)
    TelnetClient1.SendKey KeyString
End Sub

See Also

KeyMap Property, KeyDown Event, KeyPress Event, KeyUp Event