I need to set the position of the mouse on the screen. In some other similar question, it was suggested to use CGDisplayMoveCursorToPoint(CGDirectDisplayID display, CG
CGDisplayMoveCursorToPoint(CGDirectDisplayID display, CG
Swift 3 version of the answer that helped me:
let pt = CGPoint(x: 100, y: 10) let moveEvent = CGEvent(mouseEventSource: nil, mouseType: .mouseMoved, mouseCursorPosition: pt, mouseButton: .left) moveEvent?.post(tap: .cgSessionEventTap)