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.
public sealed class ChordTrieInheritance
Object → ChordTrie
Properties
Description
Gets the description if present.
Returns: String
public string? Description { get; }HasAction
Gets whether this node has an action (is a valid endpoint).
Returns: Boolean
public bool HasAction { get; }HasChildren
Gets whether this node has children (more steps possible).
Returns: Boolean
public bool HasChildren { get; }IsLeaf
Gets whether this is a leaf node (has action, no children).
Returns: Boolean
public bool IsLeaf { get; }Methods
Build(IEnumerable<InputBinding>)
Builds a trie from a collection of bindings.
Parameters:
bindings(IEnumerable<InputBinding>):
Returns: ChordTrie
public static ChordTrie Build(IEnumerable<InputBinding> bindings)ExecuteAsync(InputBindingActionContext)
Executes the action if present with the given context.
Parameters:
context(InputBindingActionContext):
Returns: Task
public Task ExecuteAsync(InputBindingActionContext context)Lookup(Hex1bKeyEvent)
Looks up a key step using a key event.
Parameters:
evt(Hex1bKeyEvent):
Returns: ChordLookupResult
public ChordLookupResult Lookup(Hex1bKeyEvent evt)Lookup(KeyStep)
Looks up a key step in this trie node.
Parameters:
step(KeyStep):
Returns: ChordLookupResult
public ChordLookupResult Lookup(KeyStep step)Register(InputBinding)
Registers a binding in the trie. Later registrations with the same key sequence override earlier ones.
Parameters:
binding(InputBinding):
public void Register(InputBinding binding)