Programming with Reflection

image\rwnprg32.gif SetMouseMap method


Syntax object.SetMouseMap Modifiers, Chord, CommandType, Commands, [CommandArguments]



Maps a mouse chord to an action. The action is determined by the CommandType and Commands arguments.

For example, the following command modifies the mouse setup so that pressing Alt while right-clicking displays the online help index:

.SetMouseMap rcAltKey, "RightBtn", rcBuiltInFunction, "HelpSearch"

This statement sends "Quit" to the host when the Control key (Ctrl) is depressed while the right mouse button is double-clicked:

.SetMouseMap rcCtrlKey, "RightBtn_DblClk", rcTransmitString, "Quit"


Modifiers Argument Type: Enumeration
A mouse chord consists of a button click (or double-click) and may also include one or more modifier keys¾Alt, Ctrl, and Shift. If you are mapping to an unmodified mouse chord, use rcNormalKey for this argument. The possible modifier keys are:


No modifier.


The Alt key.


The Control key.


The Shift key.

 To specify multiple modifier keys, use the addition operator (+). For example: rcAltKey + rcCtrlKey.

Key Argument Type: String
A string identifying a mouse chord. Use one of the following:


Left button click


Middle button click


Right button click


Left button double-click


Middle button double-click


Right button double-click

CommandType Argument Type: Enumeration
Specifies what sort of command to attach to the keystroke. The possible values are:


 Maps the mouse chord to one or more built-in functions.


 Maps the mouse chord to a string that is transmitted to the host. The string is assumed to be in the Windows character set, and is translated into the appropriate host character set as it is transmitted.


 Resets the mouse chord to its default mapping. If you use this option, the Commands argument must be an empty string. For example:

SetMouseMap rcNormalKey, "LeftBtn", rcDefaultMap, ""


 Maps the mouse chord to a single Visual Basic statement. This statement can include Visual Basic functions and statements and/or Reflection methods and properties. Use doubled quotation marks for string values within literal strings, for example:

SetMouseMap rcAltKey, "LeftBtn", rcVBCommand, "MsgBox ""Hello"""

 Note: This value is equivalent to rcRBCommand, which was used in earlier versions of Reflection.


 Maps the mouse chord to a Reflection macro. Use the Commands argument to specify the macro's name. You can pass additional information to the MacroData property using CommandArguments. Note: If the macro is not present in the current settings file or a referenced file, you will see an error when you use the specified mouse chord.


 Maps the mouse chord to a Reflection Basic script. Use the Commands argument to specify the script's path and file name. You can pass arguments to the script using CommandArguments.

Commands Argument Type: String
Specifies the action to perform when the mouse chord is pressed. Depending on the value of CommandType this can be a built-in function, a string to transmit, a Visual Basic statement, a Reflection macro, a Reflection Basic script, an RCL command, or an RCL script.

CommandArguments Argument Type: String
This argument is valid when CommandType is rcVBMacro or rcRBScript. Use it to specify additional information to be passed to the macro or script.

Note: You can map a mouse chord to no action using the "Nothing" Built-in function. For example:

.SetMouseMap rcNormalKey, "RightBtn", rcBuiltinFunction, "Nothing"


image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command