InputBinding
Namespace: Hex1b.Input
Assembly: Hex1b.dll
Represents a key binding that matches a sequence of key steps and executes an action. Supports both single-key bindings and multi-step chords.
public sealed class InputBindingInheritance
Object → InputBinding
Constructors
InputBinding(IReadOnlyList<KeyStep>, Action, string?, bool, ActionId?, bool)
Creates an input binding with a simple action handler (no context).
Parameters:
steps(IReadOnlyList<KeyStep>):action(Action):description(String):isGlobal(Boolean):actionId(Nullable<ActionId>):overridesCapture(Boolean):
public InputBinding(IReadOnlyList<KeyStep> steps, Action action, string? description = null, bool isGlobal = false, ActionId? actionId = null, bool overridesCapture = false)InputBinding(IReadOnlyList<KeyStep>, Action<InputBindingActionContext>, string?, bool, ActionId?, bool)
Creates an input binding with a synchronous context-aware action handler.
Parameters:
steps(IReadOnlyList<KeyStep>):action(Action<InputBindingActionContext>):description(String):isGlobal(Boolean):actionId(Nullable<ActionId>):overridesCapture(Boolean):
public InputBinding(IReadOnlyList<KeyStep> steps, Action<InputBindingActionContext> action, string? description = null, bool isGlobal = false, ActionId? actionId = null, bool overridesCapture = false)InputBinding(IReadOnlyList<KeyStep>, Func<InputBindingActionContext, Task>, string?, bool, ActionId?, bool)
Creates an input binding with an async context-aware action handler.
Parameters:
steps(IReadOnlyList<KeyStep>):handler(Func<InputBindingActionContext, Task>):description(String):isGlobal(Boolean):actionId(Nullable<ActionId>):overridesCapture(Boolean):
public InputBinding(IReadOnlyList<KeyStep> steps, Func<InputBindingActionContext, Task> handler, string? description = null, bool isGlobal = false, ActionId? actionId = null, bool overridesCapture = false)Properties
ActionId
A stable identifier for the action this binding performs. Used for programmatic rebinding via . Convention: "WidgetName.ActionName" (e.g., "List.MoveUp").
Returns: Nullable<ActionId>
public ActionId? ActionId { get; }Description
Optional description for this binding (for help/documentation).
Returns: String
public string? Description { get; }FirstStep
Gets the first key step of this binding (for trie insertion).
Returns: KeyStep
public KeyStep FirstStep { get; }IsGlobal
Whether this binding is global (evaluated regardless of focus). Global bindings are checked before focus-based routing.
Returns: Boolean
public bool IsGlobal { get; }IsSingleKey
Gets whether this is a single-key binding (vs a chord).
Returns: Boolean
public bool IsSingleKey { get; }OverridesCapture
Whether this binding overrides input capture. When true, this binding is checked even when another node has captured all input. Use this for menu accelerators and other app-level shortcuts that should always work.
Returns: Boolean
public bool OverridesCapture { get; }OwnerNode
The node that owns this binding (for conflict detection and debugging).
Returns: Hex1bNode
public Hex1bNode? OwnerNode { get; }Steps
The sequence of key steps that trigger this binding. Single-key bindings have exactly one step; chords have multiple steps.
Returns: IReadOnlyList<KeyStep>
public IReadOnlyList<KeyStep> Steps { get; }Methods
Alt(Hex1bKey, Action, string?)
Creates a binding for Alt+Key.
Parameters:
Returns: InputBinding
[Obsolete("Use InputBindingsBuilder fluent API instead.")]
public static InputBinding Alt(Hex1bKey key, Action handler, string? description = null)Ctrl(Hex1bKey, Action, string?)
Creates a binding for Ctrl+Key.
Parameters:
Returns: InputBinding
[Obsolete("Use InputBindingsBuilder fluent API instead.")]
public static InputBinding Ctrl(Hex1bKey key, Action handler, string? description = null)CtrlShift(Hex1bKey, Action, string?)
Creates a binding for Ctrl+Shift+Key.
Parameters:
Returns: InputBinding
[Obsolete("Use InputBindingsBuilder fluent API instead.")]
public static InputBinding CtrlShift(Hex1bKey key, Action handler, string? description = null)ExecuteAsync(InputBindingActionContext)
Executes the binding's handler with the given context.
Parameters:
context(InputBindingActionContext):
Returns: Task
public Task ExecuteAsync(InputBindingActionContext context)Plain(Hex1bKey, Action, string?)
Creates a binding for a plain key (no modifiers).
Parameters:
Returns: InputBinding
[Obsolete("Use InputBindingsBuilder fluent API instead.")]
public static InputBinding Plain(Hex1bKey key, Action handler, string? description = null)Shift(Hex1bKey, Action, string?)
Creates a binding for Shift+Key.
Parameters:
Returns: InputBinding
[Obsolete("Use InputBindingsBuilder fluent API instead.")]
public static InputBinding Shift(Hex1bKey key, Action handler, string? description = null)ToString()
Returns a string that represents the current object.
Returns: String
A string that represents the current object.
public override string ToString()