InputEventWithModifiers

Inherits: InputEventFromWindow < InputEvent < Resource < RefCounted < Object

Inherited By: InputEventGesture, InputEventKey, InputEventMouse

Base class for keys events with modifiers.

Description

Contains keys events information with modifiers support like Shift or Alt. See Node._input.

Tutorials

Properties

bool

alt_pressed

false

bool

command_or_control_autoremap

false

bool

ctrl_pressed

false

bool

meta_pressed

false

bool

shift_pressed

false

Methods

bool

is_command_or_control_pressed ( ) const

Property Descriptions

Default

false

Setter

set_alt_pressed(value)

Getter

is_alt_pressed()

State of the Alt modifier.


  • bool command_or_control_autoremap

Default

false

Setter

set_command_or_control_autoremap(value)

Getter

is_command_or_control_autoremap()

Automatically use Meta (Command) on macOS and Ctrl on other platforms. If true, ctrl_pressed and meta_pressed cannot be set.


Default

false

Setter

set_ctrl_pressed(value)

Getter

is_ctrl_pressed()

State of the Ctrl modifier.


Default

false

Setter

set_meta_pressed(value)

Getter

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

Default

false

Setter

set_shift_pressed(value)

Getter

is_shift_pressed()

State of the Shift modifier.

Method Descriptions

  • bool is_command_or_control_pressed ( ) const

On macOS, returns true if Meta (Command) is pressed.

On other platforms, returns true if Ctrl is pressed.