InputEvent

Inherits: Resource < Reference < Object

继承人: InputEventActionInputEventJoypadButtonInputEventJoypadMotionInputEventMIDIInputEventScreenDragInputEventScreenTouchInputEventWithModifiers

类别: 核心

简要说明

一般输入事件

属性

int

device

0

方法

bool

accumulate ( InputEvent with_event )

String

as_text ( ) const

float

get_action_strength ( String action ) const

bool

is_action ( String action ) const

bool

is_action_pressed ( String action ) const

bool

is_action_released ( String action ) const

bool

is_action_type ( ) const

bool

is_echo ( ) const

bool

is_pressed ( ) const

bool

shortcut_match ( InputEvent event ) const

InputEvent

xformed_by ( Transform2D xform, Vector2 local_ofs=Vector2( 0, 0 ) ) const

描述

所有类型的输入事件的基类。见 Node._input .

属性描述

违约

0

设定器

设置设备(值)

吸气剂

获取设备()

事件的设备ID。

方法说明

返回 true 如果给定的输入事件和此输入事件可以一起添加(仅适用于类型为 InputEventMouseMotion

将复制给定输入事件的位置、全局位置和速度。结果 relative 是两个事件的总和。两个事件的修饰符必须相同。

返回A String 事件的表示。

根据给定操作的状态,返回介于0.0和1.0之间的值。用于获取类型的事件值 InputEventJoypadMotion .

返回 true 如果此输入事件与任何类型的预定义操作匹配。

返回 true 如果正在按下给定的操作(并且不是 InputEventKey 事件)。与类型的事件无关 InputEventMouseMotionInputEventScreenDrag .

返回 true 如果给定的动作被释放(即未按下)。与类型的事件无关 InputEventMouseMotionInputEventScreenDrag .

  • bool is_action_type ( ) const

返回 true 如果此输入事件的类型可以分配给输入操作。

  • bool is_echo ( ) const

返回 true 如果此输入事件是回声事件(仅适用于类型为 InputEventKey

  • bool is_pressed ( ) const

返回 true 如果按下此输入事件。与类型的事件无关 InputEventMouseMotionInputEventScreenDrag .

返回 true 如果给定的输入事件正在检查相同的键 (InputEventKey )按钮 (InputEventJoypadButton )或行动 (InputEventAction

返回给定输入事件的一个副本,该输入事件的偏移量为 local_ofs 并由 xform . 与类型事件相关 InputEventMouseButtonInputEventMouseMotionInputEventScreenTouchInputEventScreenDragInputEventMagnifyGestureInputEventPanGesture .