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

feat(linux): implement hi res scroll #398

Merged
merged 4 commits into from
May 10, 2023
Merged

feat(linux): implement hi res scroll #398

merged 4 commits into from
May 10, 2023

Conversation

rszyma
Copy link
Contributor

@rszyma rszyma commented May 7, 2023

Implemented REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES for mwheel-* actions based on how my mouse sends hi-res scroll events.

From my testing, (mwheel-down 50 120) feels the same as before, while (mwheel-down 5 12) is much smoother (if an app supports hi res scroll events).

Also I don't know how, but it fixes #395

@jtroo
Copy link
Owner

jtroo commented May 8, 2023

Thanks for the PR!

That is quite strange that it fixes the bug, since it doesn't seem to change how passthrough of unhandled device events works - in this case the scroll events of a high res mouse.

Maybe it's a desktop thing where if the first type of scroll event from a given device is high-res, only high-res will be handled and low-res will be ignored. Or if low-res is sent first, then high-res will be ignored.

@jtroo
Copy link
Owner

jtroo commented May 8, 2023

It would be good to include the removal of the following text from config.adoc and kanata.kbd as part of this PR.

In Linux, not all desktop environments support the REL_WHEEL_HI_RES event, so kanata just doesn’t use it. Instead, a scroll happens when 120 or more distance units are accumulated. This may result in poor scrolling experience so in Linux it is recommended to use a distance value that is a multiple of 120.

  ;; ... In Linux, not all desktop environments
  ;; support the REL_WHEEL_HI_RES event so kanata just doesn't use it; instead a
  ;; scroll happens if 120 or more distance units are accumulated. This may result
  ;; in poor scrolling experience so in Linux it is recommended to use a distance
  ;; value that is a multiple of 120.

src/oskbd/linux.rs Outdated Show resolved Hide resolved
src/oskbd/linux.rs Outdated Show resolved Hide resolved
src/oskbd/linux.rs Outdated Show resolved Hide resolved
Copy link
Contributor Author

@rszyma rszyma left a comment

Choose a reason for hiding this comment

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

Fixed wrong math operators.

@rszyma
Copy link
Contributor Author

rszyma commented May 8, 2023

Now that I think about it, I didn't test if this didn't break normal mouse scroll wheel (without hi res scroll events). I don't have such mouse, so I need someone else to test it.

@jtroo jtroo self-requested a review May 9, 2023 04:52
@rszyma
Copy link
Contributor Author

rszyma commented May 10, 2023

Tested with 2 mice without high res scrolls: SteelSeries Rival 3 and Dell KM632. No issues.

@jtroo jtroo merged commit 8c66a31 into jtroo:main May 10, 2023
3 checks passed
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.

Bug: mwheel-* actions not working properly after using mouse scroll wheel.
2 participants