我无法确定当前是否将滚动设置为反向模式,我想显示该设置并将其用于滑块和其他东西。
我知道我可以检查一下 plist:
dict = open("/Library/Preferences/.GlobalPreferences.plist");
=> dict.objectForKey("com.apple.swipescrolldirection");
我在这里寻找任何 API。
我无法确定当前是否将滚动设置为反向模式,我想显示该设置并将其用于滑块和其他东西。
我知道我可以检查一下 plist:
dict = open("/Library/Preferences/.GlobalPreferences.plist");
=> dict.objectForKey("com.apple.swipescrolldirection");
我在这里寻找任何 API。
我刚才遇到了同样的问题,我是这样解决的:
用 Catfish_Man 的建议编辑:
NSString *scrollDirection = [[[NSUserDefaults standardUserDefaults] objectForKey:@"com.apple.swipescrolldirection"] boolValue]? @"Natural" : @"Normal";
我想你正在寻找 上的isDirectionInvertedFromDevice
房产NSEvent
。