API Reference
KeyBinding
A key binding: the keys, what they do and the words that describe them. Footers and the key map are generated from the active bindings, so what the screen says is always what the keys do.
Inheritance
- Object
- KeyBinding
Usage
Explore 2 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 2
- Method KeyBinding.Create
- Property Menu.KeyBindings
Constructors
public KeyBinding(String label, Action action, params KeyChord[] chords) #Creates a binding.
Parameters
- label System.String
- What the keys do ("select", "toggle").
- action System.Action
- The action.
- chords ConsoleMonster.Input.KeyChord[]
- The keys.
Methods
public static KeyBinding Create(String keys, String label, Action action) #KeyBindingCreates a binding from key names ("Ctrl+K", ":").
Parameters
- keys System.String
- The keys, as KeyChord.Parse accepts them.
- label System.String
- What the keys do.
- action System.Action
- The action.
Returns
The binding.
public String DisplayKeys() #StringThe key text as shown in footers: lower-case names (enter, ctrl+a), characters as typed.
Returns
The text.
public Boolean Matches(InputEvent input) #BooleanWhether an event triggers this binding.
Parameters
- input ConsoleMonster.Input.InputEvent
- The event.
Returns
True on a match.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public String? KeyText { get; set; } #How the keys are shown (for example ↑↓); null shows the first chord.
public String Group { get; set; } #The heading the binding is listed under in the key map.
public Int32 Order { get; set; } #Footer priority: lower values are shown first and dropped last when space runs out.