InputEvent¶
Inherits: Resource < Reference < Object
继承人: InputEventAction , InputEventJoypadButton , InputEventJoypadMotion , InputEventMIDI , InputEventScreenDrag , InputEventScreenTouch , InputEventWithModifiers
类别: 核心
简要说明¶
一般输入事件
方法¶
accumulate ( InputEvent with_event ) |
|
as_text ( ) const |
|
get_action_strength ( String action ) const |
|
is_action_pressed ( String action ) const |
|
is_action_released ( String action ) const |
|
is_action_type ( ) const |
|
is_echo ( ) const |
|
is_pressed ( ) const |
|
shortcut_match ( InputEvent event ) const |
|
xformed_by ( Transform2D xform, Vector2 local_ofs=Vector2( 0, 0 ) ) const |
描述¶
所有类型的输入事件的基类。见 Node._input .
方法说明¶
bool accumulate ( InputEvent with_event )
返回 true
如果给定的输入事件和此输入事件可以一起添加(仅适用于类型为 InputEventMouseMotion )
将复制给定输入事件的位置、全局位置和速度。结果 relative
是两个事件的总和。两个事件的修饰符必须相同。
String as_text ( ) const
返回A String 事件的表示。
根据给定操作的状态,返回介于0.0和1.0之间的值。用于获取类型的事件值 InputEventJoypadMotion .
返回 true
如果此输入事件与任何类型的预定义操作匹配。
返回 true
如果正在按下给定的操作(并且不是 InputEventKey 事件)。与类型的事件无关 InputEventMouseMotion 或 InputEventScreenDrag .
返回 true
如果给定的动作被释放(即未按下)。与类型的事件无关 InputEventMouseMotion 或 InputEventScreenDrag .
bool is_action_type ( ) const
返回 true
如果此输入事件的类型可以分配给输入操作。
bool is_echo ( ) const
返回 true
如果此输入事件是回声事件(仅适用于类型为 InputEventKey )
bool is_pressed ( ) const
返回 true
如果按下此输入事件。与类型的事件无关 InputEventMouseMotion 或 InputEventScreenDrag .
bool shortcut_match ( InputEvent event ) const
返回 true
如果给定的输入事件正在检查相同的键 (InputEventKey )按钮 (InputEventJoypadButton )或行动 (InputEventAction )
InputEvent xformed_by ( Transform2D xform, Vector2 local_ofs=Vector2( 0, 0 ) ) const
返回给定输入事件的一个副本,该输入事件的偏移量为 local_ofs
并由 xform
. 与类型事件相关 InputEventMouseButton , InputEventMouseMotion , InputEventScreenTouch , InputEventScreenDrag , InputEventMagnifyGesture 和 InputEventPanGesture .