Class InputEventWithModifiers
Abstract base class for input events affected by modifier keys like Shift
and Alt
.
- Inheritance
-
InputEventWithModifiers
- Derived
Remarks
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.
See Also
Properties
alt_pressed
State of the Alt
modifier.
var alt_pressed : bool = false
Property Value
Remarks
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.
var command_or_control_autoremap : bool = false
Property Value
Remarks
ctrl_pressed
State of the Ctrl
modifier.
var ctrl_pressed : bool = false
Property Value
Remarks
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.
var meta_pressed : bool = false
Property Value
Remarks
shift_pressed
State of the Shift
modifier.
var shift_pressed : bool = false
Property Value
Remarks
Methods
get_modifiers_mask
Qualifiers: const
Returns the keycode combination of modifier keys.
int get_modifiers_mask
is_command_or_control_pressed
Qualifiers: const
On macOS, returns true
if Meta
(Cmd
) is pressed.
On other platforms, returns true
if Ctrl
is pressed.
bool is_command_or_control_pressed