InputEventMouseButton

Inherits: InputEventMouse < InputEventWithModifiers < InputEvent < Resource < Reference < Object

Input event type for mouse button events.

Description

Contains mouse click information. See Node._input.

Note: On Wear OS devices, rotary input is mapped to @GlobalScope.BUTTON_WHEEL_UP and @GlobalScope.BUTTON_WHEEL_DOWN. This can be changed to @GlobalScope.BUTTON_WHEEL_LEFT and @GlobalScope.BUTTON_WHEEL_RIGHT with the ProjectSettings.input_devices/pointing/android/rotary_input_scroll_axis setting.

Tutorials

Properties

int

button_index

0

bool

canceled

false

bool

doubleclick

false

float

factor

1.0

bool

pressed

false


Property Descriptions

int button_index = 0

  • void set_button_index ( int value )

  • int get_button_index ( )

The mouse button identifier, one of the ButtonList button or button wheel constants.


bool canceled = false

  • void set_canceled ( bool value )

  • bool is_canceled ( )

If true, the mouse button event has been canceled.


bool doubleclick = false

  • void set_doubleclick ( bool value )

  • bool is_doubleclick ( )

If true, the mouse button's state is a double-click.


float factor = 1.0

  • void set_factor ( float value )

  • float get_factor ( )

The amount (or delta) of the event. When used for high-precision scroll events, this indicates the scroll amount (vertical or horizontal). This is only supported on some platforms; the reported sensitivity varies depending on the platform. May be 0 if not supported.


bool pressed = false

  • void set_pressed ( bool value )

  • bool is_pressed ( )

If true, the mouse button's state is pressed. If false, the mouse button's state is released.