@@ -67,13 +67,13 @@ class MouseController {
6767 mouseEventSource: nil , mouseType: downMouseType, mouseCursorPosition: resolvedLocation, mouseButton: button)
6868 downEvent? . setIntegerValueField ( . mouseEventClickState, value: Int64 ( clickCount) )
6969 downEvent? . flags = flags
70- downEvent? . post ( tap: CGEventTapLocation . cghidEventTap )
70+ downEvent? . post ( tap: CGEventTapLocation . cgSessionEventTap )
7171 let eventSource = CGEventSource ( event: downEvent)
7272
7373 let upEvent = CGEvent (
7474 mouseEventSource: eventSource, mouseType: upMouseType, mouseCursorPosition: resolvedLocation,
7575 mouseButton: button)
76- upEvent? . post ( tap: CGEventTapLocation . cghidEventTap )
76+ upEvent? . post ( tap: CGEventTapLocation . cgSessionEventTap )
7777 }
7878
7979 func down( _ location: CGPoint ? , button: CGMouseButton , flags: CGEventFlags ) {
@@ -83,7 +83,7 @@ class MouseController {
8383 let downEvent = CGEvent (
8484 mouseEventSource: nil , mouseType: downMouseType, mouseCursorPosition: resolvedLocation, mouseButton: button)
8585 downEvent? . flags = flags
86- downEvent? . post ( tap: CGEventTapLocation . cghidEventTap )
86+ downEvent? . post ( tap: CGEventTapLocation . cgSessionEventTap )
8787
8888 downButtons. insert ( button)
8989 }
@@ -95,7 +95,7 @@ class MouseController {
9595 let upEvent = CGEvent (
9696 mouseEventSource: nil , mouseType: upMouseType, mouseCursorPosition: resolvedLocation,
9797 mouseButton: button)
98- upEvent? . post ( tap: CGEventTapLocation . cghidEventTap )
98+ upEvent? . post ( tap: CGEventTapLocation . cgSessionEventTap )
9999 downButtons. remove ( button)
100100 }
101101
@@ -118,7 +118,7 @@ class MouseController {
118118 mouseEventSource: nil , mouseType: downMouseType, mouseCursorPosition: resolvedStart, mouseButton: button
119119 )
120120 downEvent? . flags = flags
121- downEvent? . post ( tap: CGEventTapLocation . cghidEventTap )
121+ downEvent? . post ( tap: CGEventTapLocation . cgSessionEventTap )
122122 eventSource = CGEventSource ( event: downEvent)
123123 }
124124
@@ -127,7 +127,7 @@ class MouseController {
127127 if !downButtons. contains ( button) {
128128 let upEvent = CGEvent (
129129 mouseEventSource: eventSource, mouseType: upMouseType, mouseCursorPosition: end, mouseButton: button)
130- upEvent? . post ( tap: CGEventTapLocation . cghidEventTap )
130+ upEvent? . post ( tap: CGEventTapLocation . cgSessionEventTap )
131131 }
132132 }
133133
@@ -188,7 +188,7 @@ class MouseController {
188188 event? . setIntegerValueField ( field, value: Int64 ( amount * - 1 ) )
189189 event? . flags = flags
190190
191- event? . post ( tap: CGEventTapLocation . cghidEventTap )
191+ event? . post ( tap: CGEventTapLocation . cgSessionEventTap )
192192 } else {
193193 fatalError ( " Scrolling is only available on 10.13 or later \n " )
194194 }
@@ -207,7 +207,7 @@ class MouseController {
207207 mouseEventSource: eventSource, mouseType: moveType, mouseCursorPosition: location,
208208 mouseButton: button ?? CGMouseButton . left)
209209 moveEvent? . flags = flags
210- moveEvent? . post ( tap: CGEventTapLocation . cghidEventTap )
210+ moveEvent? . post ( tap: CGEventTapLocation . cgSessionEventTap )
211211 }
212212
213213 private func getEventType( _ mouseType: mouseEventType , _ button: CGMouseButton ? = nil ) -> CGEventType {
0 commit comments