Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / MouseMapper Object / AddMapping Method
A MouseMapping object that contains a mapping between a mouse/key combination and a set of actions to perform when that mouse button combination is pressed in a host session.
Example
AddMapping Method (MouseMapper)
Adds a mouse button mapping to the current mouse map.
Syntax
expression.AddMapping( _
   ByVal mapping As MouseMapping _
) 
where expression is a variable that represents a MouseMapper Object

Parameters

mapping
A MouseMapping object that contains a mapping between a mouse/key combination and a set of actions to perform when that mouse button combination is pressed in a host session.
Remarks
A mouse/key combination can also be remapped to do nothing if the InputMapSequenceAction specified in mapping.Mapping has no InputMapActions added to it.
Example
This sample maps the mouse wheel to an action that extends the selected area one row down.
Public Sub MapMouseWheelToAction()
    Dim msmapping As MouseMapping
    Dim sequence As InputMapActionSequence
    Dim action As InputMapAction
    Dim combo As MouseButtonCombination
   
    Set msmapping = New MouseMapping
    Set sequence = New InputMapActionSequence
    Set action = New InputMapAction
    Set combo = New MouseButtonCombination
    'Set up the action to extend a selected area down one row
    action.ActionId = InputMapActionID_ExtendSelectionBlockDownAction
   
    'Add the action to the action sequence
    sequence.Add action
   
    'Set the mouse button as mouse wheel down
    combo.WheelDirection = MouseWheelDirection_WheelDown
    Set msmapping.button = combo
   
    'Map the mouse button to the action sequence
    Set msmapping.mapping = sequence
   
    'Add the new mapping to the mouse map
    ThisIbmTerminal.MouseMapper.AddMapping msmapping
 
End Sub
See Also