Skip to content

ChordTrie ​

Namespace: Hex1b.Input

Assembly: Hex1b.dll

A trie (prefix tree) for efficient chord lookup. Each node represents a key step; leaf nodes contain actions.

csharp
public sealed class ChordTrie

Inheritance ​

Object → ChordTrie

Properties ​

Description ​

Gets the description if present.

Returns: String

csharp
public string? Description { get; }

HasAction ​

Gets whether this node has an action (is a valid endpoint).

Returns: Boolean

csharp
public bool HasAction { get; }

HasChildren ​

Gets whether this node has children (more steps possible).

Returns: Boolean

csharp
public bool HasChildren { get; }

IsLeaf ​

Gets whether this is a leaf node (has action, no children).

Returns: Boolean

csharp
public bool IsLeaf { get; }

Methods ​

Build(IEnumerable<InputBinding>) ​

Builds a trie from a collection of bindings.

Parameters:

Returns: ChordTrie

csharp
public static ChordTrie Build(IEnumerable<InputBinding> bindings)

ExecuteAsync(InputBindingActionContext) ​

Executes the action if present with the given context.

Parameters:

Returns: Task

csharp
public Task ExecuteAsync(InputBindingActionContext context)

Lookup(Hex1bKeyEvent) ​

Looks up a key step using a key event.

Parameters:

Returns: ChordLookupResult

csharp
public ChordLookupResult Lookup(Hex1bKeyEvent evt)

Lookup(KeyStep) ​

Looks up a key step in this trie node.

Parameters:

Returns: ChordLookupResult

csharp
public ChordLookupResult Lookup(KeyStep step)

Register(InputBinding) ​

Registers a binding in the trie. Later registrations with the same key sequence override earlier ones.

Parameters:

csharp
public void Register(InputBinding binding)

Released under the MIT License.