Revert "Enable shortcut while CommandPalette is open (#8044)"
This reverts commit 1965fb5e73
.
This commit is contained in:
parent
ff5b2b84d2
commit
61ccf44f22
|
@ -6,7 +6,6 @@
|
|||
#include "TabPaletteItem.h"
|
||||
#include "CommandLinePaletteItem.h"
|
||||
#include "CommandPalette.h"
|
||||
#include "AppLogic.h"
|
||||
|
||||
#include <LibraryResources.h>
|
||||
|
||||
|
@ -282,8 +281,7 @@ namespace winrt::TerminalApp::implementation
|
|||
// Method Description:
|
||||
// - Process keystrokes in the input box. This is used for moving focus up
|
||||
// and down the list of commands in Action mode, and for executing
|
||||
// commands in both Action mode and Commandline mode. This would also
|
||||
// enable users to perform action using shortcuts when command palette is open.
|
||||
// commands in both Action mode and Commandline mode.
|
||||
// Arguments:
|
||||
// - e: the KeyRoutedEventArgs containing info about the keystroke.
|
||||
// Return Value:
|
||||
|
@ -293,24 +291,8 @@ namespace winrt::TerminalApp::implementation
|
|||
{
|
||||
auto key = e.OriginalKey();
|
||||
auto const ctrlDown = WI_IsFlagSet(CoreWindow::GetForCurrentThread().GetKeyState(winrt::Windows::System::VirtualKey::Control), CoreVirtualKeyStates::Down);
|
||||
auto const altDown = WI_IsFlagSet(CoreWindow::GetForCurrentThread().GetKeyState(winrt::Windows::System::VirtualKey::Menu), CoreVirtualKeyStates::Down);
|
||||
auto const shiftDown = WI_IsFlagSet(CoreWindow::GetForCurrentThread().GetKeyState(winrt::Windows::System::VirtualKey::Shift), CoreVirtualKeyStates::Down);
|
||||
|
||||
winrt::Microsoft::Terminal::TerminalControl::KeyChord kc{ ctrlDown, altDown, shiftDown, static_cast<int32_t>(key) };
|
||||
auto setting = AppLogic::CurrentAppSettings();
|
||||
auto keymap = setting.GlobalSettings().KeyMap();
|
||||
const auto action = keymap.TryLookup(kc);
|
||||
|
||||
if (action)
|
||||
{
|
||||
if (action.Action() != ShortcutAction::ToggleCommandPalette)
|
||||
{
|
||||
_close();
|
||||
}
|
||||
_dispatch.DoAction(action);
|
||||
e.Handled(true);
|
||||
}
|
||||
else if (key == VirtualKey::Up)
|
||||
if (key == VirtualKey::Up)
|
||||
{
|
||||
// Action Mode: Move focus to the next item in the list.
|
||||
SelectNextItem(false);
|
||||
|
@ -375,6 +357,10 @@ namespace winrt::TerminalApp::implementation
|
|||
// In the interest of not telling all modes to check for keybindings, limit to TabSwitch mode for now.
|
||||
if (_currentMode == CommandPaletteMode::TabSwitchMode)
|
||||
{
|
||||
auto const ctrlDown = WI_IsFlagSet(CoreWindow::GetForCurrentThread().GetKeyState(winrt::Windows::System::VirtualKey::Control), CoreVirtualKeyStates::Down);
|
||||
auto const altDown = WI_IsFlagSet(CoreWindow::GetForCurrentThread().GetKeyState(winrt::Windows::System::VirtualKey::Menu), CoreVirtualKeyStates::Down);
|
||||
auto const shiftDown = WI_IsFlagSet(CoreWindow::GetForCurrentThread().GetKeyState(winrt::Windows::System::VirtualKey::Shift), CoreVirtualKeyStates::Down);
|
||||
|
||||
auto success = _bindings.TryKeyChord({
|
||||
ctrlDown,
|
||||
altDown,
|
||||
|
|
Loading…
Reference in a new issue