This procedure maps a keystroke, and then returns information about the mapping:
Sub KeyMapDemo ()
Dim returnValue1 As String
Dim returnValue2 As Integer
With Session
.SetKeyMap rcCtrlKey, "d" , rcTransmitString, "dir" & Chr$(rcLF) & Chr$(rcCR)"
returnValue1 = .GetKeyMapCommands(rcCtrlKey, "d")
returnValue2 = .GetKeyMapCommandType(rcCtrlKey, "d")
MsgBox "returnValue1 = " & returnValue1
Select Case returnValue2
Case rcNotMapped
MsgBox "The keystroke is not mapped."
Case rcVBCommand
MsgBox "The keystroke is mapped to a VB command."
Case rcVBMacro
MsgBox "The keystroke is mapped to a VB macro."
Case rcBuiltInFunction
MsgBox "The keystroke is mapped to a built-in function."
Case rcTransmitString
MsgBox "The keystroke is mapped to a transmit string."
Case other
MsgBox "The keystroke is mapped to an undetermined command type."
End Select
End With
End Sub