KeyChord
ConsoleMonster.Input
A key combination used by key bindings: either a key with exact modifiers (Ctrl+K, Shift+Tab, F1, PageDown) or a typed character (?, :, /) that matches however it was typed.
Inheritance
- ValueType
- KeyChord
Usage
Explore 40 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 12
- Method KeyChord.Parse
- Property AppCommand.Shortcut
- Property AppHostKeys.Actions
- Property AppHostKeys.CancelAction
- Property AppHostKeys.Exit
- Property AppHostKeys.NextFocus
- Property AppHostKeys.Palette
- Property AppHostKeys.PreviousFocus
- Property AppScreens.BackKeys
- Property CommandOptions.Shortcut
- Property KeyBinding.Chords
- Property KeyHint.Chord
Accepted by parameters 28
- Method KeyChord.Equals
- Method KeyChord.op_Equality
- Method KeyChord.op_Equality
- Method KeyChord.op_Inequality
- Method KeyChord.op_Inequality
- Method KeyChord.TryParse
- Extension method AppCommand.Shortcut
- Method AppCommandFluent.Shortcut
- Extension method AppHostKeys.Actions
- Extension method AppHostKeys.CancelAction
- Extension method AppHostKeys.Exit
- Extension method AppHostKeys.NextFocus
- Extension method AppHostKeys.Palette
- Extension method AppHostKeys.PreviousFocus
- Method AppHostKeysFluent.Actions
- Method AppHostKeysFluent.CancelAction
- Method AppHostKeysFluent.Exit
- Method AppHostKeysFluent.NextFocus
- Method AppHostKeysFluent.Palette
- Method AppHostKeysFluent.PreviousFocus
- Extension method AppScreens.BackKey
- Extension method AppScreens.BackKeys
- Method AppScreensFluent.BackKey
- Method AppScreensFluent.BackKeys
- Extension method CommandOptions.Shortcut
- Method CommandOptionsFluent.Shortcut
- Constructor KeyBinding.KeyBinding
- Constructor KeyHint.KeyHint
Constructors
Methods
public bool Equals(KeyChord other) #Indicates whether the current object is equal to another object of the same type.
Parameters
- other ConsoleMonster.Input.KeyChord
- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.public override bool Equals(object? obj) #Indicates whether this instance and a specified object are equal.
Parameters
- obj object?
- The object to compare with the current instance.
Returns
bool true if obj and this instance are the same type and represent the same value; otherwise, false.public override int GetHashCode() #Returns the hash code for this instance.
Returns
int A 32-bit signed integer that is the hash code for this instance.public bool Matches(InputEvent input) #Whether an event is this chord. A Latin letter or digit chord also matches the same key on another layout: a Cyrillic layout typing й on the Q key matches q, and a French layout typing & on the 1 key matches 1. A typed Latin character always matches exactly, so remapped layouts keep their labels.
Parameters
- input ConsoleMonster.Input.InputEvent
- The event.
Returns
bool True on a match.public static bool op_Equality(KeyChord left, KeyChord right) #Equality.
Parameters
- left ConsoleMonster.Input.KeyChord
- The left chord.
- right ConsoleMonster.Input.KeyChord
- The right chord.
Returns
bool True when equal.public static bool op_Inequality(KeyChord left, KeyChord right) #Inequality.
Parameters
- left ConsoleMonster.Input.KeyChord
- The left chord.
- right ConsoleMonster.Input.KeyChord
- The right chord.
Returns
bool True when different.public static KeyChord Parse(string text) #Parses Ctrl+K,Alt+Enter, Shift+Tab, F5, PgDn, Space or a single character such as ?. Modifier and key names are case-insensitive.
Parameters
- text string
- The text.
public override string ToString() #The chord as people write it: Ctrl+K, Shift+Tab, ?.
Returns
string The name.public static bool TryParse(string? text, out KeyChord chord) #Parses a chord; see KeyChord.Parse.
Parameters
- text string?
- The text.
- chord ConsoleMonster.Input.KeyChord
- The chord.
Returns
bool Whether the text is a chord.