Click or drag to resize
SoWinExaminerViewerAddViewingMouseBinding Method

Adds a new mouse binding to the viewer.

Namespace: OIV.Inventor.Win.Viewers
Assembly: OIV.Inventor.Win (in OIV.Inventor.Win.dll) Version: 2024.2.2.0 (10.16.2.0)
Syntax
public void AddViewingMouseBinding(
	SoKeyboardEventKeys[] keys,
	SoMouseButtonEventButtons[] mouseBtn,
	SoWinExaminerViewerSoViewingFunction viewingFunc
)

Parameters

keys
Type: OIV.Inventor.EventsSoKeyboardEventKeys
mouseBtn
Type: OIV.Inventor.EventsSoMouseButtonEventButtons
viewingFunc
Type: OIV.Inventor.Win.ViewersSoWinExaminerViewerSoViewingFunction
Remarks

This method allows you to associate an array of modifier keys (of length numKey) and an array of mouse buttons (of length numMouseBtn) with a viewing operation, such as rotation or translation. The specified viewing function replaces the viewing function currently associated with the specified key and mouse button sequence.

Modifier keys (CTRL, SHIFT, CTRL+SHIFT...) can be specified in addition to the mouse buttons chosen. There is no error for specifying non-modifier keys, but they have no effect. The order of the keys and the mouse buttons is important. For example, CTRL+SHIFT+BT1 is different from SHIFT+CTRL+BT1. Likewise, CTRL+BT1+BT2 is different from CTRL+BT2+BT1.

A key and mouse button sequence cannot be associated with more than one viewing function at a time. However, more than one key and mouse button sequence can be associated with a single viewing function.

Notes:

  • Mouse button and key bindings are active in both viewing and selection mode. This means that bindings can be used to have viewing functions available in selection mode. But note that if a binding exists for a mouse button or key, then the corresponding event is not sent to the scene graph in selection mode.

  • When one of the viewing functions, e.g. OIV.Inventor.Win.Viewers.SoWinExaminerViewer.SoViewingDolly, is activated it will automatically set an appropriate cursor shape (if there is one) for that function.

  • Many keyboards have Shift and Ctrl keys on the left side and the right side. The left and right keys, e.g. LEFT_SHIFT and RIGHT_SHIFT, are different for event handling. But for convenience, assigning either one to a mouse binding effectively assigns both keys.

  • It is also possible to redefine any of the mouse buttons by handling the mouse button events before the viewer handles them (see setEventCallback()).

  • Popup menu is automatically disable when Button3 is redefined.

  • When one of the viewing functions is activated and the viewer is in "selection" mode, the viewer is switched to "viewing" mode when applying the function and then, returns in selection mode.

Limitations:

  • It is not currently possible to redefine Button1 as selection (picking). However you can implement this behavior using setEventCallback() to always send Button1 events to the scene graph.

  • In the default viewer behavior, pressing a modifier key during an LButton viewing operation will temporarily change the active viewing function. For example, while pressing LButton to spin, pressing the shift key temporarily switches to pan function. It is not currently possible to define such behavior using mouse bindings.

See Also