From dd420509ab4568ab71e77842c7eb9f562aa33952 Mon Sep 17 00:00:00 2001 From: Mason Bergstrom <13530957+MasonBergstrom@users.noreply.github.com> Date: Wed, 22 Oct 2025 21:06:33 -0700 Subject: [PATCH] [Mouse Without Borders] Adding Horizontal Scrolling Support (#42179) ## Summary of the Pull Request Added support for horizontal scrolling to Mouse Without Borders, instead of being a no-op. ## PR Checklist - [x] Closes: #37037 - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments Works in a backward compatible fashion, continuing to be a no-op when forwarded to an older version, but works once both devices are updated. ## Validation Steps Performed Built on two separate devices that are paired with each other. First tested with one device updated and one on the old code, confirming backwards compatibility support. Second tested both devices updated, confirming horizontal scroll is now working on remote device. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/modules/MouseWithoutBorders/App/Class/Common.VK.cs | 1 + src/modules/MouseWithoutBorders/App/Class/InputSimulation.cs | 3 +++ src/modules/MouseWithoutBorders/App/Class/NativeMethods.cs | 1 + 3 files changed, 5 insertions(+) diff --git a/src/modules/MouseWithoutBorders/App/Class/Common.VK.cs b/src/modules/MouseWithoutBorders/App/Class/Common.VK.cs index 79aa50c6dc..3f54a0281d 100644 --- a/src/modules/MouseWithoutBorders/App/Class/Common.VK.cs +++ b/src/modules/MouseWithoutBorders/App/Class/Common.VK.cs @@ -112,6 +112,7 @@ namespace MouseWithoutBorders internal const int WM_RBUTTONDBLCLK = 0x206; internal const int WM_MBUTTONDBLCLK = 0x209; internal const int WM_MOUSEWHEEL = 0x020A; + internal const int WM_MOUSEHWHEEL = 0x020E; internal const int WM_KEYDOWN = 0x100; internal const int WM_KEYUP = 0x101; diff --git a/src/modules/MouseWithoutBorders/App/Class/InputSimulation.cs b/src/modules/MouseWithoutBorders/App/Class/InputSimulation.cs index 0bbd8014ae..e735db814c 100644 --- a/src/modules/MouseWithoutBorders/App/Class/InputSimulation.cs +++ b/src/modules/MouseWithoutBorders/App/Class/InputSimulation.cs @@ -204,6 +204,9 @@ namespace MouseWithoutBorders.Class case Common.WM_MOUSEWHEEL: mouse_input.mi.dwFlags |= (int)NativeMethods.MOUSEEVENTF.WHEEL; break; + case Common.WM_MOUSEHWHEEL: + mouse_input.mi.dwFlags |= (int)NativeMethods.MOUSEEVENTF.HWHEEL; + break; case Common.WM_XBUTTONUP: mouse_input.mi.dwFlags |= (int)NativeMethods.MOUSEEVENTF.XUP; break; diff --git a/src/modules/MouseWithoutBorders/App/Class/NativeMethods.cs b/src/modules/MouseWithoutBorders/App/Class/NativeMethods.cs index 539e0267bd..831144f377 100644 --- a/src/modules/MouseWithoutBorders/App/Class/NativeMethods.cs +++ b/src/modules/MouseWithoutBorders/App/Class/NativeMethods.cs @@ -556,6 +556,7 @@ namespace MouseWithoutBorders.Class XDOWN = 0x0080, XUP = 0x0100, WHEEL = 0x0800, + HWHEEL = 0x1000, VIRTUALDESK = 0x4000, ABSOLUTE = 0x8000, }