コード例 #1
0
ファイル: KeyBindings.cs プロジェクト: waf/PrettyPrompt
 public KeyBindings(
     KeyPressPatterns commitCompletion      = default,
     KeyPressPatterns triggerCompletionList = default,
     KeyPressPatterns newLine         = default,
     KeyPressPatterns submitPrompt    = default,
     KeyPressPatterns historyPrevious = default,
     KeyPressPatterns historyNext     = default)
 {
     CommitCompletion      = Get(commitCompletion, new(Enter), new(Tab));
     TriggerCompletionList = Get(triggerCompletionList, new KeyPressPattern(Control, Spacebar));
     NewLine         = Get(newLine, new KeyPressPattern(Shift, Enter));
     SubmitPrompt    = Get(submitPrompt, new(Enter), new(Control, Enter), new(Control | Alt, Enter));
     HistoryPrevious = Get(historyPrevious, new KeyPressPattern(UpArrow));
     HistoryNext     = Get(historyNext, new KeyPressPattern(DownArrow));
コード例 #2
0
ファイル: KeyBindings.cs プロジェクト: waf/PrettyPrompt
 static KeyPressPatterns Get(KeyPressPatterns patterns, params KeyPressPattern[] defaultPatterns)
 => patterns.HasAny ? patterns : new(defaultPatterns);