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

Show InputPanel on focus and pointer press #4867

Merged
3 commits merged into from
Mar 10, 2020
Merged

Show InputPanel on focus and pointer press #4867

3 commits merged into from
Mar 10, 2020

Conversation

leonMSFT
Copy link
Contributor

Summary of the Pull Request

I originally thought that setting TSFInputControl::_editContext.InputPaneDisplayPolicy to be Automatic would allow the InputPanel to show and hide automatically when TSFInputControl gains and loses focus. It doesn't seem to behave that way, so we'll show the InputPanel manually.

I'll show the panel during PointerPressedHandler and during GotFocusHandler. A user will have the on-screen keyboard pop up when getting focus, but if they close the keyboard, they can simply re-tap on the terminal to bring it back up.

PR Checklist

Validation Steps Performed

Played on my surfaces book with the on screen keyboard by closing/tapping on the terminal and using the search box.

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.

Just to sanity check, clicking on the Terminal with a mouse doesn't bring this up, unless there's no keyboard attached, right?

@@ -824,6 +825,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
const auto ptr = args.Pointer();
const auto point = args.GetCurrentPoint(*this);

InputPane::GetForCurrentView().TryShow();
Copy link
Member

Choose a reason for hiding this comment

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

Does _GotFocusHandler not get fired automatically after this one? I'd think you'd only need it in the GotFocus one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it doesn't get fired if we already have focus. This call is here for the case where terminal is in focus, but the user closed the keyboard.

Copy link
Member

Choose a reason for hiding this comment

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

Okay good enough for me. (I'd appreciate adding this as a comment in code, but you do you)

@zadjii-msft zadjii-msft added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Needs-Second It's a PR that needs another sign-off Product-Terminal The new Windows Terminal. labels Mar 10, 2020
@ghost ghost requested review from miniksa, carlos-zamora and DHowett-MSFT March 10, 2020 15:47
@leonMSFT
Copy link
Contributor Author

Yup, the on screen keyboard only shows up if you don't have a keyboard attached.

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

ghost commented Mar 10, 2020

Hello @leonMSFT!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 5 hours 33 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@leonMSFT
Copy link
Contributor Author

@msftbot merge this in 1 minute

@ghost
Copy link

ghost commented Mar 10, 2020

Hello @leonMSFT!

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 won't merge this pull request until after the UTC date Tue, 10 Mar 2020 17:55:10 GMT, which is in 1 minute

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

@ghost ghost merged commit 61d6353 into master Mar 10, 2020
@ghost ghost deleted the dev/lelian/inputpanel branch March 10, 2020 17:56
abhijeetviswam pushed a commit to abhijeetviswam/terminal that referenced this pull request Mar 12, 2020
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
I originally thought that setting `TSFInputControl::_editContext.InputPaneDisplayPolicy` to be Automatic would allow the InputPanel to show and hide automatically when `TSFInputControl` gains and loses focus. It doesn't seem to behave that way, so we'll show the InputPanel manually. 

I'll show the panel during `PointerPressedHandler` and during `GotFocusHandler`. A user will have the on-screen keyboard pop up when getting focus, but if they close the keyboard, they can simply re-tap on the terminal to bring it back up.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [x] Closes microsoft#3639
* [x] CLA signed.
* [x] Tests added/passed

## Validation Steps Performed
Played on my surfaces book with the on screen keyboard by closing/tapping on the terminal and using the search box.
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-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) AutoMerge Marked for automatic merge by the bot when requirements are met Needs-Second It's a PR that needs another sign-off Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should Input Pane display policy be Automatic
3 participants