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...
InputEventWithModifiers
繼承: InputEventFromWindow < InputEvent < Resource < RefCounted < Object
被繼承: InputEventGesture, InputEventKey, InputEventMouse
受 Shift 和 Alt 等修飾鍵影響的輸入事件的抽象基底類別。
說明
Stores information about mouse, keyboard, and touch gesture input events. This includes information about which modifier keys are pressed, such as Shift or Alt. See Node._input().
Note: Modifier keys are considered modifiers only when used in combination with another key. As a result, their corresponding member variables, such as ctrl_pressed, will return false if the key is pressed on its own.
教學
屬性
|
||
|
||
|
||
device |
|
|
|
||
|
方法
BitField[KeyModifierMask] |
get_modifiers_mask() const |
is_command_or_control_pressed() const |
屬性說明
Alt 修飾鍵的狀態。
bool command_or_control_autoremap = false 🔗
自動在 macOS 上使用 Meta(Command),在其他平臺上使用 Ctrl。如果為 true,則無法設定 ctrl_pressed 和 meta_pressed。
Ctrl 修飾鍵的狀態。
Meta 修飾鍵的狀態。在 Windows 和 Linux 上代表 Windows 鍵(有時在 Linux 上稱為“meta”或“super”鍵)。在 macOS 上代表 Command 鍵。
Shift 修飾鍵的狀態。
方法說明
BitField[KeyModifierMask] get_modifiers_mask() const 🔗
返回修飾鍵的鍵碼組合。
bool is_command_or_control_pressed() const 🔗
在 macOS 上,如果 Meta(Command)是按下狀態,則返回 true 。
在其他平臺上,如果 Ctrl 是按下狀態,則返回 true 。