-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable Home and End keys in Command Palette search box #8194
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird - even if this works, I feel like this isn't the correct solution. It feels like we're taking a dependency on how we're moving the focus into the command palette, and that makes it seem fragile.
Is there some other way to eat the Home/End key presses, to prevent the TextBox from handling them? Maybe in a PreviewKeyDown
handler?
I appreciated @KevinCathcart's notes:
Should we try to make sure it works like this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(noted in comment)
I hope this is what you meant. Now Home and End keys only affect textbox no longer affect list unless pressed down with |
Huh, this seems almost right. From my playing with this branch, it seems like Ctrl+Home, Ctrl+End only move the selected item when the cursor is already at the home/end of the text box. Should we either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems right to me. I'll wait for @zadjii-msft to report on how it feels. 😄
@@ -264,6 +282,7 @@ namespace winrt::TerminalApp::implementation | |||
Windows::UI::Xaml::Input::KeyRoutedEventArgs const& e) | |||
{ | |||
auto key = e.OriginalKey(); | |||
auto const ctrlDown = WI_IsFlagSet(CoreWindow::GetForCurrentThread().GetKeyState(winrt::Windows::System::VirtualKey::Control), CoreVirtualKeyStates::Down); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is unused!
@msftbot make sure @zadjii-msft signs off |
Hello @DHowett! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, now this feels right. Thanks!
Thanks @Hegunumo! |
Cleanup extraneous local leftover from #8194 ## PR Checklist * [x] Closes leftover from #8194 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA.
🎉 Handy links: |
Cleanup extraneous local leftover from microsoft#8194 ## PR Checklist * [x] Closes leftover from microsoft#8194 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA.
Home/End will only navigate the command palette list when the user holds down Ctrl.
Closes #8191