Purpose

The module SoInteractionMapping allows for overriding the mouse and keyboard bindings of interactions provided through the Managed Interaction scheme.

Usage

Place this module into an Open Inventor scene graph with Managed Interactions, before the nodes whose interactions are to be mapped to a new mouse and keyboard binding.

Tips

Note

The order of actions in the ‘override’ fields has no influence on the precedence of the actions. If two actions have the same mapping (and are sensitive at the same position), the action that appears first in the Open Inventor scene wins.

Output Fields

self

name: self, type: SoNode

Connect this to a group node containing nodes that define Managed Interactions. This node must connected before the nodes with the interactions to have an effect.

Parameter Fields

Visible Fields

Override (overridePointingActions)

name: overridePointingActions, type: String

Sets the override string for pointing actions.

Lines must have the following structure:

[providerID “.”]actionID “:” [trigger][“,” triggers][“,”]

MyProviderID.MyActionID:SC?1

This activates ‘MyActionID’ of ‘MyProviderID’ when pressing the left mouse button (1) with Shift pressed (S) and Control ignored (C?). All other modifier keys and mouse buttons must be released, as they are not mentioned. All default triggers are ignored because there is no comma at the end.

The providerID is optional; if omitted, each actionID of all modules in the (sub-)network is mapped to the given triggers.

Triggers look like this:

[“S”[“?”]][“C”[“?”]][“A”[“?”]][“1”[“?”]][“2”[“?”]][“3”[“?”]]

S?C?A?1?2?3?

The letters denote the modifier keys: S: Shift, C: Ctrl, A: Alt.

The numbers denote the mouse buttons: 1: left, 2: middle, 3: right.

A question mark after a letter (modifier key) or a number (mouse button number) indicates that this modifier or button is completely ignored when matching (it can be pressed or released).

If a line does not end with a comma, the default triggers are ignored.

If a modifier key letter or a mouse button number is not given, the action will only trigger if the modifier or button is released.

Examples:

SCA?12

Shift and Control must be pressed (SC); Alt is ignored (A?). The action activates when pressing the left and middle mouse buttons (12). The right mouse button must be released, as it is not mentioned. Default triggers are ignored because there is no comma at the end.

S?2?3

Shift is ignored (S?); Control and Alt must be released, as they are not mentioned. The left mouse button must be released, as it is not mentioned. The middle mouse button is ignored (2?), and the right mouse button activates the command (3). Default triggers are ignored because there is no comma at the end.

SoView2DCSOExtensibleEditor.CSOBrushCreateAction:1

The action is triggered by pressing the left mouse button (1). Keyboard modifiers and other mouse buttons must be released, as they are not mentioned. Default triggers are ignored because there is no comma at the end.

SoView2DCSOExtensibleEditor.CSOBrushCreateAction:S?C2

The action is triggered by pressing the middle mouse button (2); the Shift modifier is ignored (S?), and the Control modifier must be pressed (C). The Alt modifier and all other mouse buttons must be released, as they are not mentioned. Default triggers are ignored because there is no comma at the end.

SoView2DCSOExtensibleEditor.CSOBrushCreateAction:

This will disable the action completely, as neither trigger nor comma is provided.

Override (overrideCommandActions)

name: overrideCommandActions, type: String

Sets the override string for command actions.

Lines must have the following structure:

[providerID “.”]actionID “:” [shortcut][“,” shortcuts][“,”]

Shortcuts look like this:

[“S[hift]-“][“C[trl]-“][“A[lt]-“]Keyname

or like this:

[“S[hift]+”][“C[trl]+”][“A[lt]+”]Keyname

The modifier keys can be abbreviated (S, C, A) or spelled out (Shift, Ctrl, Alt).

The modifier names and the key names are case-insensitive: Shift is the same as shift, S, or s.

If a line does not end with a comma, the default shortcuts are ignored.

Examples:

SoCameraInteraction.ViewAll:V

The ViewAll action of the SoCameraInteraction module in the (sub-)network is triggered by pressing the V key.

S-V

The action is triggered on pressing both Shift and V.

S+v

Same as above, using a ‘+’ instead of ‘-’ and a lowercase letter for the keyboard shortcut.

Shift-v

Also same as above, using the spelled-out version of the modifier key’s name.

One action can be triggered by multiple shortcuts, and both ‘+’ and ‘-’ can be mixed in the same line:

S+V,A-B

The action is triggered by either pressing Shift and V or pressing Alt and B.

Override (overrideOffsetActions)

name: overrideOffsetActions, type: String

Sets the override string for offset actions.

Lines must have the following structure:

[providerID “.”]actionID “:” [triggerEntry][“,” triggerEntries][“,”]

where triggerEntries must conform to the following:

trigger[“;” sensitivity][“;” sensitivity][“;swap”]

Sensitivity is a floating-point value that provides a multiplication factor for the offset values—if two are given, these differ for the possible two axes of an offset action.

If swap is specified, the values for the two axes are swapped. This can, for example, be used for keyboard shortcuts, since normally these are only mapped to the first axis.

A trigger can have one of three forms:

“button:”<Trigger as described in Override (overridePointingActions)>
“key:”<Trigger as described in Override (overrideCommandActions)>[“/” <Second trigger for opposite direction>]
“wheel:”[“S”[“?”]][“C”[“?”]][“A”[“?”]]

If a line does not end with a comma, the default shortcuts are ignored.

Examples:

SoGenericOffsetAction.default:button:1,

The X and Y accumulated offset values change when moving the mouse (up/down and left/right) while the left mouse button is pressed (1). Additionally, turning the mouse wheel changes the accumulated offset values by default, due to the comma at the end.

SoGenericOffsetAction.default:key:S-A;swap

The Y value of the accumulated offset increases when pressing the key A while holding Shift (S-A). Default triggers are ignored because there is no comma at the end.

SoGenericOffsetAction.default:key:S-A/A-A;swap

The same as above, but now the value also decreases when pressing A while holding Alt (A-A).

SoGenericOffsetAction.default:wheel:S

Turning the mouse wheel triggers an offset action if Shift (S) is pressed. Default triggers are ignored because there is no comma at the end.

SoGenericOffsetAction.default:wheel:S;3.5

Turning the mouse wheel while holding Shift (S) changes the offset value in steps of 3.5 (sensitivity). Default triggers are ignored because there is no comma at the end.

SoGenericOffsetAction.default:wheel:S;3.5;swap

The same as above, but now the X value instead of the Y value (swap) of the accumulated offset changes in steps of 3.5 (sensitivity) when turning the mouse wheel. Default triggers are ignored because there is no comma at the end.

For mapping keys to an offset action for stacking through slices, refer to the Interaction chapter of the module help for SoView2DSlicer.

Ignore Other Pointing Actions

name: ignoreOtherPointingActions, type: Bool, default: FALSE

If checked, all pointing actions not mentioned as override are ignored completely.

Ignore Other Command Actions

name: ignoreOtherCommandActions, type: Bool, default: FALSE

If checked, all command actions not mentioned as override are ignored completely.

Ignore Other Offset Actions

name: ignoreOtherOffsetActions, type: Bool, default: FALSE

If checked, all offset actions not mentioned as override are ignored completely.