开发者

Set cursor position in Mac OS

开发者 https://www.devze.com 2023-01-14 09:11 出处:网络
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 m

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 wor开发者_如何学运维king with Cocoa.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消