Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Shortcut
继承: Resource < RefCounted < Object
用于绑定输入的快捷键。
描述
快捷键通常用于通过 InputEvent 与 Control 元素进行交互(也叫热键)。
一个快捷键可以包含多个 InputEvent,因此能够使用多种不同的输入触发某个动作。
属性
|
方法
get_as_text() const |
|
has_valid_event() const |
|
matches_event(event: InputEvent) const |
属性说明
快捷键的 InputEvent 数组。
通常使用的 InputEvent 是 InputEventKey,尽管也可以是任何 InputEvent,包括 InputEventAction。
方法说明
返回该快捷键的第一个有效 InputEvent 的 String 形式。
bool has_valid_event() const 🔗
返回 events 是否包含有效的 InputEvent。
bool matches_event(event: InputEvent) const 🔗
返回 events 中是否有等于 event
的 InputEvent。比较事件时使用 InputEvent.is_match()。