On Mouse Input

Event node which fires when a mouse event occurs. You can choose which mouse element this node reacts to. When mouse element is chosen to be a button, the only meaningful outputs are: outputs:pressed, outputs:released and outputs:isPressed. When scroll or move events are chosen, the only meaningful outputs are: outputs:valueChanged and outputs:value. You can choose to output normalized or pixel coordinates of the mouse. Pixel coordinates are the absolute position of the mouse cursor in pixel unit. The original point is the upper left corner. The minimum value is 0, and the maximum value depends on the size of the window. Normalized coordinates are the relative position of the mouse cursor to the window. The value is always between 0 and 1.

Installation

To use this Node, you must enable omni.graph.action in the Extension Manager.

Inputs

Name

Type

Description

Default

Mouse Element (mouseElement)

token

The event to trigger the downstream execution

Left Button

Only Simulate On Play (onlyPlayback)

bool

When true, the node is only computed while Stage is being played.

True

Outputs

Name

Type

Description

Default

Pressed (pressed)

execution

Executes when mouse button was pressed. Will not execute on move or scroll events

Released (released)

execution

Executes when mouse button was released. Will not execute on move or scroll events

Moved (valueChanged)

execution

Executes when user moves the cursor or scrolls the cursor. Will not execute on button events

isPressed

bool

True if the mouse button was pressed, False if it was released or mouse element is not related to a button

Delta Value (value)

float[2]

The meaning of this output depends on Event In. Normalized Move: will output the normalized coordinates of mouse, each element of the vector is in the range of [0, 1] Pixel Move: will output the absolute coordinates of mouse, each vector is in the range of [0, pixel width/height of the window] Scroll: will output the change of scroll value Otherwise: will output [0,0]