This example changes the effect of the F4 key. It interrupts the original transmission and sends alternate data (the string "test" for this example) to input screen.
Private Sub Session_BeforeTerminalKey(Key As Long, Continue As Boolean)
'Check to see if F4 was the key pressed
If Key = rcIBMF4Key Then
'Transmit alternate data
Session.TransmitANSI "test"
'Cancel the original transmission
Continue = False
End If
End Sub