Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

InputEventMouseButton

Inherits: InputEventMouse < InputEventWithModifiers < InputEventFromWindow < InputEvent < Resource < RefCounted < Object

Represents a mouse button being pressed or released.

描述

Stores information about mouse click events. See Node._input.

教程

属性

MouseButton

button_index

0

bool

canceled

false

bool

double_click

false

float

factor

1.0

bool

pressed

false


Property Descriptions

MouseButton button_index = 0

The mouse button identifier, one of the MouseButton 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 double_click = false

  • void set_double_click ( bool value )

  • bool is_double_click ( )

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.