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.

InputEventJoypadButton

Inherits: InputEvent < Resource < RefCounted < Object

Represents a gamepad button being pressed or released.

描述

Input event type for gamepad buttons. For gamepad analog sticks and joysticks, see InputEventJoypadMotion.

教程

属性

JoyButton

button_index

0

bool

pressed

false

float

pressure

0.0


Property Descriptions

JoyButton button_index = 0

Button identifier. One of the JoyButton button constants.


bool pressed = false

  • void set_pressed ( bool value )

  • bool is_pressed ( )

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


float pressure = 0.0

  • void set_pressure ( float value )

  • float get_pressure ( )

Represents the pressure the user puts on the button with their finger, if the controller supports it. Ranges from 0 to 1.