Gestures in the Open CASCADE Web Viewer provide intuitive user interaction capabilities by mapping specific mouse movements or key combinations to predefined actions. Key points include:

  • Mouse Gestures (MouseGesture): Represent various user inputs such as selection, zooming, panning, rotation, and dragging. These gestures can be customized and associated with mouse keys or modifier keys.

  • Scroll Actions (ScrollActions): Enable scrolling to perform operations like zooming, panning, or rotating the view. The behavior can be adjusted using modifier keys and scroll multipliers.

Bindings:

  • Mouse Action Bindings (MouseActionBinding): Map specific mouse gestures to mouse buttons or key modifiers.
  • Scroll Action Bindings (ScrollActionBinding): Define actions for scroll events with optional modifiers and configurable sensitivity.
  • Key Action Bindings (KeysActionBinding): Link keyboard keys or combinations to viewer actions.

Customization and Management The InputBindings interface allows users to configure, retrieve, or remove these bindings programmatically, ensuring flexibility for tailored interaction setups.

// setting gesture for left mouse button
const aLeftMouseBtnBinding = anInputBindings.getMouseKeyBinding(MouseKey.LeftButton);
aLeftMouseBtnBinding.gesture = MouseGesture.Zoom;