Receiving high precision WM_MOUSEWHEEL events with Logitech mouse on Windows 10
Asked Answered
A

1

6

To improve scrolling in my application, I recently added support for high-resolution scrolling wheel events. According to the documentation this is pretty straightforward: The handler for WM_MOUSEWHEEL should support arbitrary values as opposed to just +/- 120.

Examples of applications doing this properly are Firefox and Chrome on Windows.

I am using a Logitech mouse with a high-res wheel (MX Master 3), but I noticed that all the events I am receiving are just +/- 120. However, I could find two pretty weird work-arounds:

  • Rename my program to Firefox.exe
  • Focus on Firefox (with my app in the background), move the mouse over and scroll there

The second trick works with other things as well. For example, it makes the Windows 10 Settings app scroll smoothly. Here's a demo of the difference in action (first 4 seconds focused, then unfocused with Firefox having focus): https://www.youtube.com/watch?v=gb1FUtyLxUg&feature=youtu.be

I assume the driver is doing this for compatibility with older apps that can't handle anything that isn't 120. But is there a way for my app to opt-in to get the better events? Or does the Logitech driver simply hardcode a bunch of browsers and everyone else is out of luck?

Acedia answered 5/12, 2020 at 20:29 Comment(1)
I'm also using MX Masters 3, and using Microsoft Spy++ reveals that WM_MOUSEWHEEL's delta values can become other than the multiples of 120 when Firefox is in focus, but other apps are treated with 120 multiples. Even Word, which has special treatment. So based only on this it is safe to say that this feature is hard-coded specifically for these application. Though I want to believe otherwise.Behead
F
1

In the latest software from Logitech called Logi Options+ there is a built-in list of 4 applications where it enables high-resolution wheel scrolling. The list includes msedge.exe, iexplore.exe, chrome.exe and firefox.exe. This logic is present in logioptionsplus_agent.exe.

In their previous software SetPoint you could send a specific window message to one of its hidden windows to enable smooth scrolling in foreground application, but in Options+ they changed that.

I have made a small DLL that patches logioptionsplus_agent.exe in-memory to extend the list of applications that support high-res scrolling. It works for current and previous versions of Logi Options+, and may require updating the code when new versions change the calling code.

Here is the link to the GitHub repository: https://github.com/igvk/LogiOptionsPlus-InMemoryPatching

Instructions:

  • place file version.dll from the archive near logioptionsplus_agent.exe (by default, C:\Program Files\LogiOptionsPlus)
  • create text file wheel_apps_list.txt in %AppData%\logioptionsplus (e.g., C:\Users\User\AppData\Roaming\logioptionsplus\wheel_apps_list.txt) which contains the list of executables that will support high-res wheel scrolling (example provided in the archive)
  • reload background process Logi Options+ Agent (you can do it from the task manager by killing the processes logioptionsplus_*, this way they will auto restart)

When a new version of Logi Options+ is installed (manually or automatically), you need to put version.dll into Logi Options+ path again (installer deletes everything there).

Fortunia answered 4/5, 2023 at 17:57 Comment(6)
I would like to see that done... Apparently, Logitech does not care for their product enough to do itBedcover
@JoãoPortela, I have implemented this idea of in-memory patching LogiOptionsPlus to support hi-res wheel in other apps. I will add it to my answer soon.Fortunia
@Fortunia Thank you for sharing this! It looks like the link is dead. Would you mind sharing either another version of your DLL, or detailing how you went about creating it so that others can benefit?Gerigerianna
@dstaley, I have updated the link. I was considering putting the source code into github, though it needed some effort to clean it up, and I didn't manage doing it yet.Fortunia
@Fortunia thank you for updating the link! And yes either open sourcing your code or sharing at least the bulk of it in your answer would be greatly appreciated!Gerigerianna
@dstaley, You may check the source on GitHub now!Fortunia

© 2022 - 2024 — McMap. All rights reserved.