private void AddKey(TermInfo.Database db, TermInfo.WellKnownStrings keyId, ConsoleKey key, bool shift, bool alt, bool control) { string keyFormat = db.GetString(keyId); if (!string.IsNullOrEmpty(keyFormat)) { KeyFormatToConsoleKey[keyFormat] = new ConsoleKeyInfo('\0', key, shift, alt, control); } }
private void AddKey(TermInfo.Database db, TermInfo.WellKnownStrings keyId, ConsoleKey key, bool shift, bool alt, bool control) { ReadOnlyMemory <char> keyFormat = db.GetString(keyId).AsMemory(); if (!keyFormat.IsEmpty) { KeyFormatToConsoleKey[keyFormat] = new ConsoleKeyInfo(key == ConsoleKey.Enter ? '\r' : '\0', key, shift, alt, control); } }
private void AddKey(TermInfo.Database db, TermInfo.WellKnownStrings keyId, ConsoleKey key) { AddKey(db, keyId, key, shift: false, alt: false, control: false); }