Skip to content

KeyStepBuilder ​

Namespace: Hex1b.Input

Assembly: Hex1b.dll

Fluent builder for constructing key steps in an input binding. Supports chaining modifiers, keys, and multi-step chords.

csharp
public sealed class KeyStepBuilder

Inheritance ​

Object → KeyStepBuilder

Methods ​

Action(Action, string?) ​

Completes the binding with the given action handler.

Parameters:

csharp
public void Action(Action handler, string? description = null)

Action(Action<InputBindingActionContext>, string?) ​

Completes the binding with a context-aware action handler. The context provides access to app-level services like focus navigation.

Parameters:

csharp
public void Action(Action<InputBindingActionContext> handler, string? description = null)

Action(Func<InputBindingActionContext, Task>, string?) ​

Completes the binding with an async context-aware action handler.

Parameters:

csharp
public void Action(Func<InputBindingActionContext, Task> handler, string? description = null)

Alt() ​

Adds Alt modifier to the current step.

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Alt()

Ctrl() ​

Adds Ctrl modifier to the current step.

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Ctrl()

Global() ​

Marks this binding as global (evaluated regardless of focus). Global bindings are checked before focus-based routing. Useful for menu bar accelerators that should work from anywhere.

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Global()

Key(Hex1bKey) ​

Sets the key for the current step.

Parameters:

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Key(Hex1bKey key)

OverridesCapture() ​

Marks this binding as overriding input capture. When another node has captured all input, this binding will still be checked. Use for menu accelerators and app-level shortcuts that should always work.

Returns: KeyStepBuilder

csharp
public KeyStepBuilder OverridesCapture()

Shift() ​

Adds Shift modifier to the current step.

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Shift()

Then() ​

Commits the current step and starts a new one for chords.

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Then()

Triggers(ActionId, Action, string?) ​

Completes the binding by registering it for the specified action. The handler is provided and registered in the action registry for future rebinding.

Parameters:

  • actionId (ActionId): The action this binding triggers.
  • handler (Action): The handler to execute (no context).
  • description (String): Optional description for help/documentation.
csharp
public void Triggers(ActionId actionId, Action handler, string? description = null)

Triggers(ActionId, Action<InputBindingActionContext>, string?) ​

Completes the binding by registering it for the specified action. The handler is provided and registered in the action registry for future rebinding.

Parameters:

csharp
public void Triggers(ActionId actionId, Action<InputBindingActionContext> handler, string? description = null)

Triggers(ActionId, Func<InputBindingActionContext, Task>, string?) ​

Completes the binding by registering it for the specified action. The handler is provided and registered in the action registry for future rebinding.

Parameters:

csharp
public void Triggers(ActionId actionId, Func<InputBindingActionContext, Task> handler, string? description = null)

Triggers(ActionId) ​

Completes the binding by rebinding a previously registered action to this key. The handler is auto-resolved from the action registry.

Parameters:

  • actionId (ActionId): The action to rebind. Must have been previously registered via .
csharp
public void Triggers(ActionId actionId)

Released under the MIT License.