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

Visual Studio Extension: Home and End keys should move the text cursor to the beginning and end of the input text box #622

Open
mack-at-pieces opened this issue Feb 10, 2025 · 3 comments
Assignees
Labels
app:pieces copilot module Pieces copilot module app:visual studio bug Something isn't working os:windows status:triaged The ticket has been reviewed, prioritized, categorized, and assigned to the appropriate team member.

Comments

@mack-at-pieces
Copy link
Collaborator

Discussed in #476

Originally posted by icnocop November 25, 2024
Hi.

Thank you for "Pieces for Developers".

When using the Visual Studio extension, the input text box in the Pieces Copilot tab does not respond to the Home and End keys as expected.

I expected the Home and End keys to move the text cursor to the beginning and end of the input text box, respectively.

Instead, the Home and End keys switch to first and last tabs, respectively.
For example, pressing the Home key switches to the Solution Explorer tab, which is also docked on the right side of the IDE.
Pressing the End key switches to the Notifications tab, which is also docked on the right side of the IDE.

If I had typed some text in the input text box, I expected to be able to jump to the beginning and end of the input text box, using the Home and End keys respectfully.

image

Thank you.

Pieces for Visual Studio 3.0.1.0
Visual Studio 2022 17.12.0

@pieces-support-bot
Copy link

Hi @mack-at-pieces - Thank you so much for creating this issue. Your issue has been automatically triaged and routed to the proper Pieces team member. Look for a follow-up within the next 24 hours.

In the meantime, please check out these helpful resources:

We appreciate your patience and contribution to making Pieces better!

@pieces-support-bot pieces-support-bot bot added bug Something isn't working os:windows status:new The ticket has been created and is awaiting initial review. app:visual studio app:pieces copilot module Pieces copilot module labels Feb 10, 2025
@robert-at-pieces
Copy link

robert-at-pieces commented Feb 10, 2025

Will be gathering notes here as I look into this.

Possibly related:
https://weblog.west-wind.com/posts/2021/May/25/WebView2-Home-and-End-Key-Problems-inside-of-WPF-TabControl-Containers

^This seems to be right on the money. Using the Copilot as a floating window instead of docked/tabbed saw the hotkeys behaving in an expected manner.


Relevant: MicrosoftEdge/WebView2Feedback#4147 (comment)

@robert-at-pieces
Copy link

@icnocop - So this seems to be a little trickier than expected. I don't believe I have access to change Visual Studio's TabControl behavior and the tabs are intercepting the Home/End keys.

If I mark the key press event as handled, it no longer is intercepted, but it also no longer gets to the webview.

I've tried marking the keypress event as handled and forwarding it to the webview with a javascript document dispatchEvent, but it seems to drop some keypresses and feels quite poor to use.

Will update when there is a proper solution.

@mack-at-pieces mack-at-pieces added status:triaged The ticket has been reviewed, prioritized, categorized, and assigned to the appropriate team member. and removed status:new The ticket has been created and is awaiting initial review. labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:pieces copilot module Pieces copilot module app:visual studio bug Something isn't working os:windows status:triaged The ticket has been reviewed, prioritized, categorized, and assigned to the appropriate team member.
Projects
None yet
Development

No branches or pull requests

2 participants