Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

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 ( bool value )

  • bool is_pressed ( )

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


float pressure = 0.0

  • void set_pressure ( float value )

  • float get_pressure ( )

如果控制器支持,则表示用户用手指在按钮上施加的压力。范围从 01