OmniGraph Node omni.graph.ui.ReadMouseState

omni.graph.ui.ReadMouseState Properties

Name

Value

Version

1

Extension

omni.graph.ui

Has State?

False

Implementation Language

C++

Default Memory Type

cpu

Generated Code Exclusions

None

uiName

Read Mouse State

__categories

input:mouse

Generated Class Name

OgnReadMouseStateDatabase

Python Module

omni.graph.ui

omni.graph.ui.ReadMouseState Description

Reads the current state of the mouse. You can choose which mouse element this node is associated with. When mouse element is chosen to be a button, only outputs:isPressed is meaningful. When coordinates are chosen, only outputs:coords and outputs:window are meaningful.

Pixel coordinates are the position of the mouse cursor in screen pixel units with (0,0) top left. Normalized coordinates are values between 0-1 where 0 is top/left and 1 is bottom/right. By default, coordinates are relative to the application window, but if ‘Use Relative Coords’ is set to true, then coordinates are relative to the workspace window containing the mouse pointer.

omni.graph.ui.ReadMouseState Inputs

Name

Type

Default

Required?

Descripton

inputs:mouseElement

token

Left Button

Y

The mouse input to check the state of

displayGroup

parameters

allowedTokens

Left Button,Right Button,Middle Button,Forward Button,Back Button,Normalized Mouse Coordinates,Pixel Mouse Coordinates

__allowedTokens

{“LeftButton”: “Left Button”, “RightButton”: “Right Button”, “MiddleButton”: “Middle Button”, “ForwardButton”: “Forward Button”, “BackButton”: “Back Button”, “MouseCoordsNormalized”: “Normalized Mouse Coordinates”, “MouseCoordsPixel”: “Pixel Mouse Coordinates”}

uiName

Mouse Element

__default

“Left Button”

inputs:useRelativeCoords

bool

False

Y

When true, the output ‘coords’ is made relative to the workspace window containing the mouse pointer instead of the entire application window

uiName

Use Relative Coords

omni.graph.ui.ReadMouseState Outputs

Name

Type

Default

Required?

Descripton

outputs:coords

float[2]

None

Y

The coordinates of the mouse. If the mouse element selected is a button, this will output a zero vector.

outputs:isPressed

bool

None

Y

True if the button is currently pressed, false otherwise. If the mouse element selected is a coordinate, this will output false.

outputs:window

token

None

Y

The name of the workspace window containing the mouse pointer if ‘Use Relative Coords’ is true and the mouse element selected is a coordinate