Post

Replies

Boosts

Views

Activity

Reply to Emulate double leftclick on MacOS
try this. let position = self.correctedCursorPosition // an internal variable holding the intended position of the click let eventDown = CGEvent(mouseEventSource: source, mouseType: .leftMouseDown, mouseCursorPosition: position , mouseButton: .left) eventDown?.setIntegerValueField(.mouseEventClickState, value: 2) let eventUp = CGEvent(mouseEventSource: source, mouseType: .leftMouseUp, mouseCursorPosition: position , mouseButton: .left) eventUp?.setIntegerValueField(.mouseEventClickState, value: 2) eventDown?.post(tap: .cghidEventTap) eventUp?.post(tap: .cghidEventTap)
May ’23