ther0n / UnnaturalScrollWheels

Invert scroll direction for physical scroll wheels while maintaining "Natural" scrolling for trackpads on MacOS
GNU General Public License v3.0
3.3k stars 71 forks source link

Not setting property isDirectionInvertedFromDevice #90

Open Tom-Evers opened 2 months ago

Tom-Evers commented 2 months ago

It seems that inverting the scroll direction doesn't properly set the property isDirectionInvertedFromDevice for the scrolling event. I think it used to, but I don't know when exactly it broke. My guess is it's due to an OS update (currently running Sonoma 14.5).

Some context: I'm creating an application that has some elements that need to ignore natural scrolling, but as it is now I can't distinguish between my naturally scrolling trackpad and my "unnaturally" scrolling scroll wheel. This used to work:

@implementation MyOwnNSView

- (void)scrollWheel:(NSEvent*)event {
    const bool natural = [event isDirectionInvertedFromDevice];
    ...
}

@end
Tom-Evers commented 2 months ago

This should probably go into the scroll interceptor

If vertical "unnatural" is turned on but horizontal isn't, it should probably split the scroll event into two: One with only the "unnaturalized" vertical scrolling that and the property isDirectionInvertedFromDevice set to false, and one with the horizontal scrolling where everything is unchanged.

I'd try to fix it myself, but I've got a bit of a weird development environment and I can't really build the project.