A MacOS Application that moves the mouse
Movemouse is a MacOS Application that moves the mouse based on Vorce/Jerry project. It uses CGEvent that defines an opaque type that represents a low-level hardware event. It ofers a simple interface to randomly move the mouse across the screen.
Movemouse is MacOS 11.4 Big Sur or later compatible.
Code example:
This following code is used to **move** the mouse from one point to another.
`CGEvent(mouseEventSource: nil,
mouseType: CGEventType.mouseMoved,
mouseCursorPosition: point,
mouseButton: CGMouseButton.left)?.post(tap: CGEventTapLocation.cghidEventTap)`
It can be uset also to **click** in some points of the screen using the next function:
`CGEvent(mouseEventSource: nil,
mouseType: CGEventType.leftMouseUp,
mouseCursorPosition: point,
mouseButton: mouseButton)?.post(tap: CGEventTapLocation.cghidEventTap)`
Don’t forget to allow the app in settings security/accesilibity (each time you compile if you are using it directly from XCode)
In the next video you can see a demo of how it works.
Having trouble with Pages? Check out our documentation or contact support and we’ll help you sort it out.