Skip to content

InputBindingsBuilder

Namespace: Hex1b.Input

Assembly: Hex1b.dll

Fluent builder for constructing input bindings for a widget. Pre-populated with widget defaults, allowing inspection and modification.

csharp
public sealed class InputBindingsBuilder

Inheritance

ObjectInputBindingsBuilder

Constructors

InputBindingsBuilder()

Creates an empty builder.

csharp
public InputBindingsBuilder()

Properties

Bindings

Gets all key bindings currently configured. Inspect this at debug time to see default bindings.

Returns: IReadOnlyList<InputBinding>

csharp
public IReadOnlyList<InputBinding> Bindings { get; }

CharacterBindings

Gets all character bindings currently configured. Character bindings are checked after key bindings as a fallback.

Returns: IReadOnlyList<CharacterBinding>

csharp
public IReadOnlyList<CharacterBinding> CharacterBindings { get; }

DragBindings

Gets all drag bindings currently configured.

Returns: IReadOnlyList<DragBinding>

csharp
public IReadOnlyList<DragBinding> DragBindings { get; }

MouseBindings

Gets all mouse bindings currently configured.

Returns: IReadOnlyList<MouseBinding>

csharp
public IReadOnlyList<MouseBinding> MouseBindings { get; }

Methods

Alt()

Starts building a key step with Alt modifier.

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Alt()

AnyCharacter()

Starts building a character binding that matches any printable text.

Returns: CharacterStepBuilder

csharp
public CharacterStepBuilder AnyCharacter()

Character(Func<string, bool>)

Starts building a character binding with a custom predicate.

Parameters:

Returns: CharacterStepBuilder

csharp
public CharacterStepBuilder Character(Func<string, bool> predicate)

Clear()

Clears all bindings (including defaults).

csharp
public void Clear()

Ctrl()

Starts building a key step with Ctrl modifier.

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Ctrl()

Drag(MouseButton)

Starts building a drag binding for the given button. Drag bindings capture the mouse on button down and receive move/up events until release.

Parameters:

Returns: DragStepBuilder

csharp
public DragStepBuilder Drag(MouseButton button)

GetAllActionIds()

Returns all unique action IDs across all binding types.

Returns: IReadOnlyList<ActionId>

csharp
public IReadOnlyList<ActionId> GetAllActionIds()

GetBindings(ActionId)

Returns all key bindings with the specified action ID.

Parameters:

Returns: IReadOnlyList<InputBinding>

csharp
public IReadOnlyList<InputBinding> GetBindings(ActionId actionId)

Key(Hex1bKey)

Starts building a key step with the given key (no modifiers).

Parameters:

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Key(Hex1bKey key)

Mouse(MouseButton)

Starts building a mouse binding for the given button.

Parameters:

Returns: MouseStepBuilder

csharp
public MouseStepBuilder Mouse(MouseButton button)

Remove(ActionId)

Removes all bindings (key, mouse, character, and drag) with the specified action ID. The action handler remains in the registry for future rebinding via .

Parameters:

csharp
public void Remove(ActionId actionId)

Remove(Hex1bKey, Hex1bModifiers)

Removes all bindings that start with the specified key and modifiers.

Parameters:

csharp
public void Remove(Hex1bKey key, Hex1bModifiers modifiers = Hex1bModifiers.None)

RemoveAll()

Removes all bindings of every type (key, mouse, character, and drag). Action handlers remain in the registry for future rebinding.

csharp
public void RemoveAll()

Shift()

Starts building a key step with Shift modifier.

Returns: KeyStepBuilder

csharp
public KeyStepBuilder Shift()

Released under the MIT License.