Up to date

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

Shortcut

继承: Resource < RefCounted < Object

用于绑定输入的快捷键。

描述

快捷键通常用于通过 InputEventControl 元素进行交互(也叫热键)。

一个快捷键可以包含多个 InputEvent,因此能够使用多种不同的输入触发某个动作。

属性

Array

events

[]

方法

String

get_as_text ( ) const

bool

has_valid_event ( ) const

bool

matches_event ( InputEvent event ) const


属性说明

Array events = []

  • void set_events ( Array value )

  • Array get_events ( )

快捷键的 InputEvent 数组。

通常使用的 InputEventInputEventKey,尽管也可以是任何 InputEvent,包括 InputEventAction


方法说明

String get_as_text ( ) const

返回该快捷键的第一个有效 InputEventString 形式。


bool has_valid_event ( ) const

返回 events 是否包含有效的 InputEvent


bool matches_event ( InputEvent event ) const

返回 events 中是否有等于 eventInputEvent