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

Change OSX on_scroll event for trackpad #207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ArtemKrin
Copy link

@ArtemKrin ArtemKrin commented Dec 27, 2019

Hello!
Want to purpose allow to get finest trackpad on_scroll event on Mac OSX (pointed in pixel)
before event got (dx,dy)=(0,0) for small finger moving.

allow to get finest trackpad on_scroll event on Mac OSX (pointed in pixel)
before event got (dx,dy)=(0,0) for small finger moving
@moses-palmer
Copy link
Owner

Thank you for your contribution!

From the documentation:

Key to access an integer field that contains pixel-based scrolling data. The scrolling data represents the change in horizontal position since the last scrolling event from a Mighty Mouse scroller.

Does this mean that this is limited to work on a specific set of hardware, or is that just Apple speak for a generic mouse will scroll wheel?

I recently merged a PR that corrected scrolling for the controller by forcing deltas to be integers. That is because CGEventCreateScrollWheelEvent used to generate fake events works with discrete number of pixels, and thus cannot handle fractional values. Do you know of a way to work around this to enable your resolution improvements to be reusable by the controller?

@abrichr
Copy link

abrichr commented Nov 8, 2022

Confirmed working for me on standard built-in trackpad.

To clarify, the returned values for dy/dx remain integers, not fractions. The only difference with this PR is that slow scrolling produces non-zero values for dy/dx, whereas before there were lots of zero values, thus rendering those events useless.

Thank you @moses-palmer for the excellent library, and @ArtemKrin for the improvement!

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.

3 participants