fix: trackpad scrolling shouldn't also scroll on background apps
This commit is contained in:
1 parent
9969a07b22
commit
cacb7891e7
2 files changed
+4
-2
No files matched your search
@@ -35,8 +35,9 @@ class ScrollwheelEvents {
|
||||
}
|
||||
|
||||
private static let handleEvent: CGEventTapCallBack = { _, type, cgEvent, _ in
|
||||
if type.rawValue == NSEvent.EventType.scrollWheel.rawValue {
|
||||
// block scrolling globally
|
||||
if type.rawValue == NSEvent.EventType.scrollWheel.rawValue,
|
||||
cgEvent.getIntegerValueField(.scrollWheelEventIsContinuous) != 0 {
|
||||
// block continuous (trackpad) scrolling; let discrete (mouse) scrolling through
|
||||
return nil
|
||||
} else if (type == .tapDisabledByUserInput || type == .tapDisabledByTimeout) && shouldBeEnabled {
|
||||
CGEvent.tapEnable(tap: eventTap!, enable: true)
|
||||
|
||||
@@ -85,6 +85,7 @@ class TrackpadEvents {
|
||||
return
|
||||
}
|
||||
if activeTouches.count > 1 {
|
||||
ScrollwheelEvents.toggle(true)
|
||||
CursorEvents.deadZoneInitialPosition = nil
|
||||
NavigationSwipeDetector.hasDetected(activeTouches)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user