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¶
Inherits: InputEventFromWindow < InputEvent < Resource < RefCounted < Object
Inherited By: InputEventGesture, InputEventKey, InputEventMouse
受 Shift 和 Alt 等修饰键影响的输入事件的抽象基类。
Description¶
存储鼠标、键盘、触摸手势等输入事件的相关信息。包括按下了哪些修饰键等信息,修饰键包括 Shift、Alt 等。见 Node._input。
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
Methods¶
BitField<KeyModifierMask> |
get_modifiers_mask ( ) const |
is_command_or_control_pressed ( ) const |
Property Descriptions¶
bool alt_pressed = false
Alt 修饰键的状态。
bool command_or_control_autoremap = false
Automatically use Meta (Cmd) on macOS and Ctrl on other platforms. If true
, ctrl_pressed and meta_pressed cannot be set.
bool ctrl_pressed = false
Ctrl 修饰键的状态。
bool meta_pressed = false
Meta 修饰键的状态。在 Windows 和 Linux 上代表 Windows 键(有时在 Linux 上称为“meta”或“super”键)。在 macOS 上代表 Command 键。
bool shift_pressed = false
Shift 修饰键的状态。
Method Descriptions¶
BitField<KeyModifierMask> get_modifiers_mask ( ) const
返回修饰键的键码组合。
bool is_command_or_control_pressed ( ) const
On macOS, returns true
if Meta (Cmd) is pressed.
On other platforms, returns true
if Ctrl is pressed.