This example maps two keystroke combinations. Where literal strings are used within other strings (as in the MacroName argument to RunMacro), double quotation marks must be used. A line continuation character (a space followed by an underscore) is used to break up the longer lines.

Sub SetKeyMapDemo ()

With Session

'Map Alt+t to run the MyMacro.

.SetKeyMap rcAlt, "t", _

".RunMacro ""MyMacro"", """" "


'Map Ctrl+q to transmit the string "90" followed by Enter.

.SetKeyMap rcCtrl, "q", _

".TransmitAnsi ""90"" .TransmitTerminalKey rcIbmEnterKey"

End With

End Sub