private void OnKeyDown_InputEditText(object sender, KeyEventArgs e) { if (e.Key != Key.Tab) { autoCompleteSet = null; } switch (e.Key) { case Key.Return: string input = InputEditText.Text; HandleCommand(input); InputEditText.Text = string.Empty; FireFX(); e.Handled = true; break; case Key.Tab: if (autoCompleteSet == null) { autoCompleteSet = autoCompleteManager.GetAutoCompleteSet(); } if (autoCompleteSet != null) { InputEditText.Text = autoCompleteSet.Context.Input + autoCompleteSet.Next; InputEditText.CaretIndex = InputEditText.Text.Length; if (autoCompleteSet.Length == 1) { autoCompleteSet = null; } } e.Handled = true; break; } }
private void OnPreviewKeyDown_InputEditText(object sender, KeyEventArgs e) { if (e.Key != Key.Tab) { autoCompleteSet = null; } switch (e.Key) { case Key.Up: recentCmdManager.AddPointer(1); ApplyRecentInputCmd(); e.Handled = true; break; case Key.Down: recentCmdManager.AddPointer(-1); ApplyRecentInputCmd(); e.Handled = true; break; } }