invariant/Scroll-Reverser — pull request #6 by stevschmid (2013-03-28 23:45:37+00:00)
Title: change the way the trackpad is detected

Hey Nick

As promised I dug deep into the OSX mechanics to workaround the 4-finger swipe problem (just kidding, found this reasonable approach pretty quickly).

The key: ``kCGScrollWheelEventIsContinuous``
It seems to report ``NSScrollWheel`` events of the trackpad as 1/continuous/pixel-based while (ordinary) mice as 0/discontinuous/line-based.

Honestly, that's one heck of an assumption right there. But I tested it out with a few mice (even one with a non-clicky scroll wheel) and it seems to always report 0. This allows for a much better and cleaner detection algorithm.

If there are truly mice out there which report the scroll events as continuous (maybe a few) we could add the old detection method back as a "legacy detection" option in the preferences.

But first: Test it out if it works for you ;)