private void HandleKeyInputResultAction(InputEventsFilterHandlerArgs args) { switch (args.Result) { case KeyInputFilterResult.AutoComplete_Start: if (_hostInterface.InputPosition > -1) { DoAutoComplete(); } break; case KeyInputFilterResult.AutoComplete_Cancel: CancelCurrentAutoComplete(); break; case KeyInputFilterResult.AutoComplete_SelectPrevious: SelectPreviousOption(); break; case KeyInputFilterResult.AutoComplete_SelectNext: SelectNextOption(); break; case KeyInputFilterResult.AutoComplete_Submit: SubmitCurrentSelection(); break; } }
private void HandleKeyInputResultAction(InputEventsFilterHandlerArgs args) { switch (args.Result) { case KeyInputFilterResult.Input_CommandExecutionSubmit: _inputString = _interface.GetCurrentInputString(); _interface.Out.Standard.WriteLine(); lock (_locker) System.Threading.Monitor.Pulse(_locker); break; } }
// key input filter listener private void HandleKeyInputResultAction(InputEventsFilterHandlerArgs args) { switch (args.Result) { case KeyInputFilterResult.Input_Submit: SubmitInput(); args.IsHandled = true; break; case KeyInputFilterResult.Input_ShowPreviousHistory: ShowPreviousSubmit(); args.IsHandled = true; break; case KeyInputFilterResult.Input_ShowNextHistory: ShowNextSubmit(); args.IsHandled = true; break; case KeyInputFilterResult.Input_Focus: RTB.ScrollToCaret(); args.IsHandled = true; break; case KeyInputFilterResult.Input_MoveToStart: RTB.SelectionStart = _inputStartPosition; args.IsHandled = true; break; case KeyInputFilterResult.Input_SelectToStart: int endSelect = RTB.SelectionStart; RTB.SelectionStart = _inputStartPosition; RTB.SelectionLength = endSelect - _inputStartPosition; break; case KeyInputFilterResult.Exec_CancelCommandExecution: args.IsHandled = true; if (_invoker.IsExecuting) // if the invoker is not executing, then assume the system is executing (e.g., on startup) and cannot be canceled { _invoker.CancelExecution(); } break; } }