InputEventWithModifiers
继承: InputEventFromWindow
< InputEvent
< Resource
< RefCounted
< Object
派生: InputEventGesture
, InputEventKey
, InputEventMouse
Abstract base class for input events affected by modifier keys like Shift
and 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
.
属性
bool | alt_pressed |
bool | command_or_control_autoremap |
bool | ctrl_pressed |
bool | meta_pressed |
bool | shift_pressed |
方法
KeyModifierMask | get_modifiers_mask ( ) const1 |
bool | is_command_or_control_pressed ( ) const1 |
属性说明
bool
alt_pressed = false
State of the Alt
modifier.
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
State of the Ctrl
modifier.
bool
meta_pressed = false
State of the Meta
modifier. On Windows and Linux, this represents the Windows key (sometimes called "meta" or "super" on Linux). On macOS, this represents the Command key.
bool
shift_pressed = false
State of the Shift
modifier.
方法说明
KeyModifierMask get_modifiers_mask ( ) const1
Returns the keycode combination of modifier keys.
bool
is_command_or_control_pressed ( ) const1
On macOS, returns true
if Meta
(Cmd
) is pressed.
On other platforms, returns true
if Ctrl
is pressed.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。