Table of Contents

Class Shortcut

Namespace
Godot
Assembly
GodotSharp.dll

Shortcuts are commonly used for interacting with a Control element from an InputEvent (also known as hotkeys).

One shortcut can contain multiple InputEvent's, allowing the possibility of triggering one action with multiple different inputs.

public class Shortcut : Resource, IDisposable
Inheritance
Shortcut
Implements
Inherited Members

Constructors

Shortcut()

public Shortcut()

Properties

Events

The shortcut's InputEvent array.

Generally the InputEvent used is an InputEventKey, though it can be any InputEvent, including an InputEventAction.

public Array Events { get; set; }

Property Value

Array

Methods

GetAsText()

Returns the shortcut's first valid InputEvent as a string.

public string GetAsText()

Returns

string

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

HasValidEvent()

Returns whether Events contains an InputEvent which is valid.

public bool HasValidEvent()

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

MatchesEvent(InputEvent)

Returns whether any InputEvent in Events equals event.

public bool MatchesEvent(InputEvent @event)

Parameters

event InputEvent

Returns

bool