Skip to content

InputOverrideWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A container widget that overrides input bindings for all descendant widgets of specified types. Overrides cascade through the widget tree — any widget of a matching type within the subtree will have the override applied after its default bindings and any per-instance .

csharp
public sealed record InputOverrideWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<InputOverrideWidget>

Inheritance

ObjectHex1bWidgetInputOverrideWidget

Implements

Constructors

InputOverrideWidget(Hex1bWidget)

A container widget that overrides input bindings for all descendant widgets of specified types. Overrides cascade through the widget tree — any widget of a matching type within the subtree will have the override applied after its default bindings and any per-instance .

Parameters:

csharp
public InputOverrideWidget(Hex1bWidget Content)

Properties

Content

Returns: Hex1bWidget

csharp
public Hex1bWidget Content { get; init; }

Methods

Override<TWidget>(Action<InputBindingsBuilder>)

Adds or replaces a binding override for all descendant widgets of type TWidget. The configure callback runs after the widget's default bindings and any per-instance WithInputBindings configurator.

Parameters:

  • configure (Action<InputBindingsBuilder>): A callback that receives the and can add, remove, or remap bindings using , , and the Triggers methods.

Returns: InputOverrideWidget

A new with the override added.

csharp
public InputOverrideWidget Override<TWidget>(Action<InputBindingsBuilder> configure) where TWidget : Hex1bWidget

Examples

csharp
ctx.InputOverride(
    ctx.VStack([list1, list2, textbox1])
)
.Override(b =>
{
    b.Remove(ListWidget.MoveUp);
    b.Key(Hex1bKey.K).Triggers(ListWidget.MoveUp);
})
.Override(b =>
{
    b.Remove(TextBoxWidget.MoveUp);
    b.Key(Hex1bKey.K).Ctrl().Triggers(TextBoxWidget.MoveUp);
});

Released under the MIT License.