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
Try CGWarpMouseCursorPosition()
. It doesn't require a display ID.
If you want a display ID, you can pick an element, using whatever criteria you like, from the array returned by [NSScreen screens]
. Invoke -deviceDescription
on that NSScreen
object. From the dictionary that's returned, invoke -objectForKey:
with the key @"NSScreenNumber"
.