fix: trackpad scrolling shouldn't also scroll on background apps

This commit is contained in:
lwouis committed 2026-03-10 21:33:44 +01:00
1 parent 9969a07b22
commit cacb7891e7
2 files changed
+4 -2

No files matched your search

+3 -2
View File
@@ -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)
+1
View File
@@ -85,6 +85,7 @@ class TrackpadEvents {
return
}
if activeTouches.count > 1 {
ScrollwheelEvents.toggle(true)
CursorEvents.deadZoneInitialPosition = nil
NavigationSwipeDetector.hasDetected(activeTouches)
}