Skip to content
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

Merged
2 commits merged into from Nov 30, 2020
Merged

Disable Home and End keys in Command Palette search box #8194

2 commits merged into from Nov 30, 2020

Conversation

ghost
Copy link

@ghost ghost commented Nov 8, 2020

Home/End will only navigate the command palette list when the user holds down Ctrl.

Closes #8191

@ghost ghost changed the title Disable Home and End keys in searchbox Disable Home and End keys in Commandpalette searchbox Nov 8, 2020
Copy link
Member

@zadjii-msft zadjii-msft left a 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?

@zadjii-msft zadjii-msft self-assigned this Nov 10, 2020
@DHowett
Copy link
Member

DHowett commented Nov 13, 2020

I appreciated @KevinCathcart's notes:

For what is it worth, it looks (from experimentation) like VSCode does the following:

Horizontal navigation commands like ← or Home affect the text box. Vertical navigation commands like ↓,PgUp, or Ctrl+Home affect the list.

That seems to me to be a logical way to differentiate without losing functionality. Of course, how to actually implement that cleanly may still be an open question.

Should we try to make sure it works like this?

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(noted in comment)

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 13, 2020
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 13, 2020
@ghost
Copy link
Author

ghost commented Nov 13, 2020

I hope this is what you meant. Now Home and End keys only affect textbox no longer affect list unless pressed down with Ctrl
I might be misunderstanding things.

@zadjii-msft
Copy link
Member

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:

  • just not do the Ctrl+Home/Ctrl+end thing at all
  • Make sure that it works regardless of where the cursor is?

@zadjii-msft zadjii-msft removed their assignment Nov 16, 2020
@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 16, 2020
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 16, 2020
@zadjii-msft zadjii-msft self-assigned this Nov 20, 2020
Copy link
Member

@DHowett DHowett left a 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);
Copy link
Member

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!

@DHowett
Copy link
Member

DHowett commented Nov 25, 2020

@msftbot make sure @zadjii-msft signs off

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Nov 25, 2020
@ghost
Copy link

ghost commented Nov 25, 2020

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:

  • I'll only merge this pull request if it's approved by @zadjii-msft

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".

@DHowett DHowett changed the title Disable Home and End keys in Commandpalette searchbox Disable Home and End keys in Command Palette search box Nov 25, 2020
@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Nov 25, 2020
Copy link
Member

@zadjii-msft zadjii-msft left a 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!

@zadjii-msft zadjii-msft removed their assignment Nov 30, 2020
@ghost ghost merged commit 9cffe27 into microsoft:main Nov 30, 2020
@ghost ghost deleted the dev/8191-confusing_behavior branch November 30, 2020 16:53
@Don-Vito
Copy link
Contributor

Thanks @Hegunumo!

ghost pushed a commit that referenced this pull request Dec 17, 2020
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.
@ghost
Copy link

ghost commented Jan 28, 2021

🎉Windows Terminal Preview v1.6.10272.0 has been released which incorporates this pull request.:tada:

Handy links:

mpela81 pushed a commit to mpela81/terminal that referenced this pull request Jan 28, 2021
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.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing behavior in Command Palette when pressing "Home" during search
3 participants