Skip to content
0.2.0-dev Download ZIP
46 lines ·2.8 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="InputEventWithModifiers" inherits="InputEventFromWindow" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 Abstract base class for input events affected by modifier keys like [kbd]Shift[/kbd] and [kbd]Alt[/kbd].
5 </brief_description>
6 <description>
7 Stores information about mouse, keyboard, and touch gesture input events. This includes information about which modifier keys are pressed, such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See [method Node._input].
8 [b]Note:[/b] Modifier keys are considered modifiers only when used in combination with another key. As a result, their corresponding member variables, such as [member ctrl_pressed], will return [code]false[/code] if the key is pressed on its own.
9 </description>
10 <tutorials>
11 <link title="Using InputEvent">$DOCS_URL/tutorials/inputs/inputevent.html</link>
12 </tutorials>
13 <methods>
14 <method name="get_modifiers_mask" qualifiers="const">
15 <return type="int" enum="KeyModifierMask" is_bitfield="true" />
16 <description>
17 Returns the keycode combination of modifier keys.
18 </description>
19 </method>
20 <method name="is_command_or_control_pressed" qualifiers="const">
21 <return type="bool" />
22 <description>
23 On macOS, returns [code]true[/code] if [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) is pressed.
24 On other platforms, returns [code]true[/code] if [kbd]Ctrl[/kbd] is pressed.
25 </description>
26 </method>
27 </methods>
28 <members>
29 <member name="alt_pressed" type="bool" setter="set_alt_pressed" getter="is_alt_pressed" default="false">
30 State of the [kbd]Alt[/kbd] modifier.
31 </member>
32 <member name="command_or_control_autoremap" type="bool" setter="set_command_or_control_autoremap" getter="is_command_or_control_autoremap" default="false">
33 Automatically use [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) on macOS and [kbd]Ctrl[/kbd] on other platforms. If [code]true[/code], [member ctrl_pressed] and [member meta_pressed] cannot be set.
34 </member>
35 <member name="ctrl_pressed" type="bool" setter="set_ctrl_pressed" getter="is_ctrl_pressed" default="false">
36 State of the [kbd]Ctrl[/kbd] modifier.
37 </member>
38 <member name="device" type="int" setter="set_device" getter="get_device" overrides="InputEvent" default="16" />
39 <member name="meta_pressed" type="bool" setter="set_meta_pressed" getter="is_meta_pressed" default="false">
40 State of the [kbd]Meta[/kbd] modifier. On Windows and Linux, this represents the Windows key (sometimes called "meta" or "super" on Linux). On macOS, this represents the Command key.
41 </member>
42 <member name="shift_pressed" type="bool" setter="set_shift_pressed" getter="is_shift_pressed" default="false">
43 State of the [kbd]Shift[/kbd] modifier.
44 </member>
45 </members>
46</class>