mirror of
https://github.com/godotengine/godot
synced 2024-11-05 16:53:09 +00:00
c92f83d3ca
Made serialization of Command optional. If command is serialized, Control (On Win/Linux) or Meta (on Mac) are not. Example use case: You are on Windows and you set a shortcut to be Control + E. This would serialize as Command=true and Control=true. If you then run this project on Mac, you would need to press Command AND Control to activate the shortcut - which is not what is intended. Now, you can set store_command to true, and it will only serialize to Command = true (no Control serialized). On Windows, this means Control. On Mac, it means only command.
37 lines
1.8 KiB
XML
37 lines
1.8 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="InputEventWithModifiers" inherits="InputEventFromWindow" version="4.0">
|
|
<brief_description>
|
|
Base class for keys events with modifiers.
|
|
</brief_description>
|
|
<description>
|
|
Contains keys events information with modifiers support like [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See [method Node._input].
|
|
</description>
|
|
<tutorials>
|
|
<link title="InputEvent">https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link>
|
|
</tutorials>
|
|
<methods>
|
|
</methods>
|
|
<members>
|
|
<member name="alt" type="bool" setter="set_alt" getter="get_alt" default="false">
|
|
State of the [kbd]Alt[/kbd] modifier.
|
|
</member>
|
|
<member name="command" type="bool" setter="set_command" getter="get_command" default="false">
|
|
State of the [kbd]Cmd[/kbd] modifier.
|
|
</member>
|
|
<member name="control" type="bool" setter="set_control" getter="get_control" default="false">
|
|
State of the [kbd]Ctrl[/kbd] modifier.
|
|
</member>
|
|
<member name="meta" type="bool" setter="set_metakey" getter="get_metakey" default="false">
|
|
State of the [kbd]Meta[/kbd] modifier.
|
|
</member>
|
|
<member name="shift" type="bool" setter="set_shift" getter="get_shift" default="false">
|
|
State of the [kbd]Shift[/kbd] modifier.
|
|
</member>
|
|
<member name="store_command" type="bool" setter="set_store_command" getter="is_storing_command" default="true">
|
|
If [code]true[/code], pressing [kbd]Cmd[/kbd] on macOS or [kbd]Ctrl[/kbd] on all other platforms will both be serialized as [member command]. If [code]false[/code], those same keys will be serialized as [member meta] on macOS and [member control] on all other platforms.
|
|
This aids with cross-platform compatibility when developing e.g. on Windows for macOS, or vice-versa.
|
|
</member>
|
|
</members>
|
|
<constants>
|
|
</constants>
|
|
</class>
|