Shortcut
Resource of alternative input shortcuts, separate from commands and InputMap.
Shortcut stores InputEvent alternatives and matches events; it does not register a hotkey or execute an action by itself. For a first-press command, separately check pressed/echo and UI routing.
Events is a shared array rather than a snapshot. Array edits change the resource without Changed; a setter or explicit EmitChanged notifies observers. Events are shared too. HasValidEvent checks for an InputEvent resource, not a complete usable binding.
InputEventShortcut is recognized by reference to this resource rather than equal events on another Shortcut. Do not put such triggers in Events. Matching, releases, modifiers, shared arrays and Changed were tested without GUI; control availability and dispatch were not accepted.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
ShortcutConstructor
public Shortcut();Creates an owned shortcut resource without events. Does not register a hotkey, connect to InputMap or execute a command by itself. Assign it to a control supporting Shortcut or match events explicitly.
Properties1
EventsProperty
public Reckfell.Collections.Array Events { get; set; }Array of alternative InputEvent bindings. Setter stores a shared array and emits Changed; getter also exposes shared backing storage. Direct Add/Remove/Clear edits are visible to the resource but emit no Changed. Assign a prepared array via the setter or explicitly EmitChanged after a valid edit. The setter forbids InputEventShortcut entries; do not create recursive shortcuts.
Methods5
GetAsTextstring
public string GetAsText();Returns AsText of the first InputEvent entry, not a list of all alternatives. Returns "None" without one. A display label neither proves a usable binding nor supplies a stable ID/persistence format.
stringFirst InputEvent display label or "None".
GetEventsReckfell.Collections.Array
public Reckfell.Collections.Array GetEvents();Returns a wrapper over the shared untyped event Array. Container edits change the resource without Changed; event resources are shared too. Dispose the owned Array wrapper after use, but not borrowed InputEvent wrappers still used by others. Prepare a separate array and, when needed, separate resources for independent editing.
Reckfell.Collections.ArrayOwned wrapper over a shared untyped Array; dispose the wrapper after use.
HasValidEventbool
public bool HasValidEvent();Tests for at least one non-null InputEvent reference. An empty InputEventKey without an assigned Keycode passes too. true does not mean the binding is reachable from the current keyboard or assigned to a control.
boolPresence of an InputEvent resource, not full binding validation.
MatchesEventbool
public bool MatchesEvent(InputEvent @event);Matches alternatives through IsMatch with exact=true: key modifiers must match, but press/release are not themselves filtered. Checks no current Input state and executes no command. There is no separate InputMap device filter. InputEventShortcut matches by reference to this Shortcut, not array equality; such a trigger can match an empty Shortcut too. Check IsPressed/IsEcho separately for commands that should run only on the initial press.
| Name | Type | Default |
|---|---|---|
event | InputEvent | — |
eventNon-null InputEvent to match/bind; wrapper identity is generally not the matching criterion.
boolAlternative match or Shortcut-trigger identity match, not a decision to execute a command.
SetEventsvoid
public void SetEvents(Reckfell.Collections.Array events);Assigns a shared array of alternative InputEvents and emits Changed. Clones neither events nor container and registers no command. Rejects InputEventShortcut before assignment; mutating the returned array is not a safe way around that rule.
| Name | Type | Default |
|---|---|---|
events | Reckfell.Collections.Array | — |
eventsAlternative InputEvent array without InputEventShortcut; the setter retains shared storage.