Skip to content

Conversation

aymanbagabas
Copy link

@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
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
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
case WM_MOUSEHWHEEL:
if (delta > 0)
{
return MakeOutput(_keyMap.at(VK_LEFT));
Copy link
Member

Choose a reason for hiding this comment

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

Okay, that's really cool actually. alternate scroll does this?

winrt::Microsoft::Terminal::Core::Point wheelDelta{ 0, static_cast<int32_t>(HIWORD(wparam)) };
if (message == WM_MOUSEHWHEEL)
{
wheelDelta.X = wheelDelta.Y;
Copy link
Member

Choose a reason for hiding this comment

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

if you want to get too clever, you can probably std::swap(wheelDelta.X, wheelDelta.Y)

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
3 participants