Skip to content

Conversation

aymanbagabas
Copy link
Contributor

@aymanbagabas aymanbagabas commented Aug 15, 2025

Summary of the Pull Request

This adds support for horizontal mouse wheel events (WM_MOUSEHWHEEL). With this change, applications running in the terminal can now receive and respond to horizontal scroll inputs from the mouse/trackpad.

References and Relevant Issues

Closes #19245
Closes #10329

Validation Steps Performed

Tested terminal applications that receive horizontal mouse wheel events.

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

@aymanbagabas
Copy link
Contributor Author

@microsoft-github-policy-service agree

@aymanbagabas aymanbagabas force-pushed the support-hwheel branch 5 times, most recently from e326ed1 to 90a82d4 Compare August 15, 2025 21:20
Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

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

I'd refactor the functions to take X and Y simultaneously, but I'm also okay with merging it as-is now. I can try to do this.

Comment on lines 508 to 511
return _sendMouseEventHelper(terminalPosition,
WM_MOUSEWHEEL,
delta.X != 0 ? WM_MOUSEHWHEEL : WM_MOUSEWHEEL,
modifiers,
::base::saturated_cast<short>(delta),
::base::saturated_cast<short>(delta.X != 0 ? delta.X : delta.Y),
Copy link
Member

Choose a reason for hiding this comment

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

Oh interesting... I wonder if we should refactor _sendMouseEventHelper to allow for both X and Y to be passed? You don't have to do this in this PR of course - I can do that as a follow up (or I push into your PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left it as is because _sendMouseEventHelper is used for other buttons with a delta value of zero. Instead, we should perhaps refactor _core.SendMouseEvent to make it take a Core::Point delta instead of short. However, that feels like a larger endeavor with little to no gain 😕

I will leave the decision to you

aymanbagabas and others added 5 commits September 11, 2025 09:38
This adds support for horizontal mouse wheel events (WM_MOUSEHWHEEL).
With this change, applications running in the terminal can now receive
and respond to horizontal scroll inputs from the mouse/trackpad.

Fixes: microsoft#19245
Co-authored-by: Dustin L. Howett <[email protected]>
@DHowett
Copy link
Member

DHowett commented Sep 11, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@aymanbagabas
Copy link
Contributor Author

@DHowett @j4james I've formatted the changes and fixed an issue

@DHowett
Copy link
Member

DHowett commented Sep 11, 2025

/ap run

@DHowett
Copy link
Member

DHowett commented Sep 11, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@aymanbagabas
Copy link
Contributor Author

@DHowett Could you please rerun the pipeline?

@DHowett
Copy link
Member

DHowett commented Sep 11, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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 is excellent work. Thank you so much for being comprehensive and for being patient with our slow code reviews. 🙂

This should be out in tonight's Canary build! I'll also mark it up as considered for the next update to the 1.24 preview release.

@DHowett DHowett merged commit 814f78e into microsoft:main Sep 11, 2025
15 checks passed
DHowett pushed a commit that referenced this pull request Sep 16, 2025
This adds support for horizontal mouse wheel events (`WM_MOUSEHWHEEL`).
With this change, applications running in the terminal can now receive
and respond to horizontal scroll inputs from the mouse/trackpad.

Closes #19245
Closes #10329

(cherry picked from commit 814f78e)
Service-Card-Id: PVTI_lADOAF3p4s4BBcTlzgep1sM
Service-Version: 1.24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConHost: VTInput support synthesizing wheel left/right horizontal scroll gesture on trackpad scrolls viewport vertically
4 participants