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 = false

  • void set_alt_pressed ( value: bool )
  • bool is_alt_pressed ( )

State of the Alt modifier.


bool command_or_control_autoremap = false

  • void set_command_or_control_autoremap ( value: bool )
  • bool is_command_or_control_autoremap ( )

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

  • void set_ctrl_pressed ( value: bool )
  • bool is_ctrl_pressed ( )

State of the Ctrl modifier.


bool meta_pressed = false

  • void set_meta_pressed ( value: bool )
  • bool is_meta_pressed ( )

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

  • void set_shift_pressed ( value: bool )
  • bool is_shift_pressed ( )

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.

2

本方法通常需要用户覆盖才能生效。

1

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。