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

scrolling improvements for aqua #35

Closed
wants to merge 2 commits into from

Conversation

chrstphrchvz
Copy link
Contributor

@chrstphrchvz chrstphrchvz commented May 29, 2018

Here are two separate commits for supporting scrolling on macOS aqua (cf. #24). These were tested with Tcl::pTk, so I'm assuming they'll be applicable to Perl/Tk.

  1. Use the correct scaling factor for MouseWheel event units; see https://rt.cpan.org/Ticket/Display.html?id=125048. Adapted from http://wiki.tcl.tk/3893:

Kevin Walzer On OS X/Aqua the correct mousewheel binding would be:

bind .t.c <MouseWheel> {%W yview scroll [expr {- (%D)}] units}
  1. Mouse buttons 4 and 5 being used for scrolling is specific to X11, i.e. not all Unix windowingsystems do this (e.g. aqua does not). So instead of assuming X11 by checking $Tk::Platform, check windowingsystem eq 'x11' instead. This prevents the issue of someone's many-buttoned mouse from causing scroll events on aqua. This also matches the usage in https://core.tcl.tk/tips/doc/trunk/tip/171.md

@chrstphrchvz chrstphrchvz force-pushed the mousewheelbind-patch branch 2 times, most recently from 6321040 to 3558b0f Compare July 11, 2018 20:36
@chrstphrchvz
Copy link
Contributor Author

I am considering revising this to support horizontal scrolling as well, so for now I will close this and put any non-aqua changes I think are ready in another PR.

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.

1 participant