Skip to content

Change OSX on_scroll event for trackpad#207

Open
ArtemKrin wants to merge 1 commit intomoses-palmer:masterfrom
ArtemKrin:patch-1
Open

Change OSX on_scroll event for trackpad#207
ArtemKrin wants to merge 1 commit intomoses-palmer:masterfrom
ArtemKrin:patch-1

Conversation

@ArtemKrin
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown

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