I want to write a little vnc similar program that moves the Mac OS cursor to a position (x, y) given through a protocol which gets data from Bonjour service. The problem is that I don't know how to move the cursor!
I'm working with Cocoa.
Click on the "Keyboard and Mouse" option and select the "Trackpad" tab to access trackpad settings. Look at the tracking speed and double-click speed sliders to ensure that the pointer is set somewhere in the middle, between the Slow and Fast options.
Go to the 'Pointer Options' tab. 5. At the bottom of the window, check mark 'Show Location of Pointer when I press the CTRL key'.
On your Mac, use the Pointer pane of Accessibility Display preferences to change the size and color of the pointer to make it easier to find on the screen. To change these preferences, choose Apple menu > System Preferences, click Accessibility , click Display, then click Pointer.
Launch System Preferences from your Mac's Dock, from the Applications folder, or from the Apple menu bar ( -> System Preferences...). Click the Accessibility preference pane. In the side column, under "Vision," click Display. Click the Pointer tab in the window of options.
You can be forgiven for not looking in Quartz Display Services for this one. The function you're after is CGWarpMouseCursorPosition
.
Since the documentation doesn't say, you'll have to experiment to determine which co-ordinate system it uses—i.e., where the origin is and which way positive y goes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With