Mac "natural scroll" setting reverses option-scroll zooming and it shouldn't

Issue #431 resolved
Robert Leach created an issue

USE CASE: WHAT DO YOU WANT TO DO?

I want zoom-in to be a scroll up (or "scroll forward") motion and zoom-out be a scroll down (or "scroll back") motion regardless of the "natural scroll" setting in mac system preferences.

STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)

  1. On a mac, go to system preferences -> mouse (or trackpad?) and make sure the "natural scroll" checkbox is checked
  2. In treeview, hold the option key and scroll up/down
  3. go to system preferences -> mouse (or trackpad?) and make sure the "natural scroll" checkbox is unchecked
  4. In treeview, hold the option key and scroll up/down

CURRENT BEHAVIOR

When "natural scroll" is checked, scrolling down zooms in and scrolling up zooms out. When it's unchecked, scrolling down zooms out and scrolling up zooms in.

EXPECTED BEHAVIOR

Whether "natural scroll" is checked or not, scrolling up should zoom in and scrolling down should zoom out.

DEVELOPERS ONLY SECTION

SUGGESTED CHANGE (Pseudocode optional)

I suggest implementing the solution found here:

http://stackoverflow.com/questions/7074882/java-how-to-get-the-scrolling-method-in-os-x-lion

It references a plist file reader, which would be a new dependency:

https://github.com/3breadt/dd-plist

And making sure that direction of option-scroll is reversed in the java code when "natural scroll" is true.

FILES AFFECTED (where the changes will be implemented) - developers only

unknown

LEVEL OF EFFORT - developers only

minor

COMMENTS

Comments (7)

  1. Robert Leach reporter

    This resolves issue 431. Moving your fingers up on the mouse now zooms in regardless of the natural scroll setting on a mac.

    I had to create a new dependency for reading apple's plist files in system preferences. The dependency is a jar file obtained here:

    https://github.com/3breadt/dd-plist/releases/download/dd-plist-1.17/dd-plist-r117-bin.zip

    From the project located here:

    https://github.com/3breadt/dd-plist

    I discovered the package in the solution to this stack exchange question:

    http://stackoverflow.com/questions/7074882/java-how-to-get-the-scrolling-method-in-os-x-lion

    There were 2 to-do items in the added code:

    1. The mac system preferences natural scroll setting is determined upon instantiation of the class. This means that if the user changes the setting while treeview is running, the zoom behavior will be the opposite of that desired. This seemed like a minor issue which I didn't know how to efficiently resolve, so I figured it would best be left as a TODO in case anyone knows how to do it.
    2. The code to determine whether the operating system is mac os x is duplicated because it already exists in TreeView3.java. Ideally, the operation would only be done once in TreeView3.java and checked in this class, but there was no direct link to do so and I wasn't sure how best to do that.

    If anyone has a good idea of how to do these things, please comment during the code review.

    → <<cset cba9c7659ac4>>

  2. Log in to comment