InputEventJoypadButton

继承: InputEvent < Resource < RefCounted < Object

代表按下或松开的游戏手柄按钮。

描述

游戏手柄按钮的输入事件类型。对于游戏手柄模拟摇杆和操纵杆,请参阅 InputEventJoypadMotion

教程

属性

JoyButton

button_index

0

bool

pressed

false

float

pressure

0.0


属性说明

JoyButton button_index = 0 🔗

按钮标识符。JoyButton 按钮常量之一。


bool pressed = false 🔗

  • void set_pressed(value: bool)

  • bool is_pressed()

如果为 true,按钮的状态被按下。如果为 false,按钮的状态被释放。


float pressure = 0.0 🔗

  • void set_pressure(value: float)

  • float get_pressure()

已弃用: This property is never set by the engine and is always 0.