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.
public sealed class InputBindingsBuilderInheritance
Object → InputBindingsBuilder
Constructors
InputBindingsBuilder()
Creates an empty builder.
public InputBindingsBuilder()Properties
Bindings
Gets all key bindings currently configured. Inspect this at debug time to see default bindings.
Returns: IReadOnlyList<InputBinding>
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>
public IReadOnlyList<CharacterBinding> CharacterBindings { get; }DragBindings
Gets all drag bindings currently configured.
Returns: IReadOnlyList<DragBinding>
public IReadOnlyList<DragBinding> DragBindings { get; }MouseBindings
Gets all mouse bindings currently configured.
Returns: IReadOnlyList<MouseBinding>
public IReadOnlyList<MouseBinding> MouseBindings { get; }Methods
Alt()
Starts building a key step with Alt modifier.
Returns: KeyStepBuilder
public KeyStepBuilder Alt()AnyCharacter()
Starts building a character binding that matches any printable text.
Returns: CharacterStepBuilder
public CharacterStepBuilder AnyCharacter()Character(Func<string, bool>)
Starts building a character binding with a custom predicate.
Parameters:
predicate(Func<String, Boolean>):
Returns: CharacterStepBuilder
public CharacterStepBuilder Character(Func<string, bool> predicate)Clear()
Clears all bindings (including defaults).
public void Clear()Ctrl()
Starts building a key step with Ctrl modifier.
Returns: KeyStepBuilder
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:
button(MouseButton):
Returns: DragStepBuilder
public DragStepBuilder Drag(MouseButton button)GetAllActionIds()
Returns all unique action IDs across all binding types.
Returns: IReadOnlyList<ActionId>
public IReadOnlyList<ActionId> GetAllActionIds()GetBindings(ActionId)
Returns all key bindings with the specified action ID.
Parameters:
actionId(ActionId):
Returns: IReadOnlyList<InputBinding>
public IReadOnlyList<InputBinding> GetBindings(ActionId actionId)Key(Hex1bKey)
Starts building a key step with the given key (no modifiers).
Parameters:
key(Hex1bKey):
Returns: KeyStepBuilder
public KeyStepBuilder Key(Hex1bKey key)Mouse(MouseButton)
Starts building a mouse binding for the given button.
Parameters:
button(MouseButton):
Returns: MouseStepBuilder
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:
actionId(ActionId):
public void Remove(ActionId actionId)Remove(Hex1bKey, Hex1bModifiers)
Removes all bindings that start with the specified key and modifiers.
Parameters:
key(Hex1bKey):modifiers(Hex1bModifiers):
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.
public void RemoveAll()Shift()
Starts building a key step with Shift modifier.
Returns: KeyStepBuilder
public KeyStepBuilder Shift()