Re: Setting cursor position
Re: Setting cursor position
- Subject: Re: Setting cursor position
- From: email@hidden
- Date: Sun, 14 Apr 2002 17:12:22 +0200
On dimanche, avril 14, 2002, at 10:27 , David Ahmed wrote:
Hi gang!
Does anyone know how to set the cursor X and Y screen position. I can
locate
it no problem (using a mouse event and NSPoint) but I need to be able to
position it from within my app.
You need to use the CoreGraphics API.
In
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/
CoreGraphics.framework/Versions/A/Headers/CGRemoteOperation.h
CG_EXTERN CGEventErr CGWarpMouseCursorPosition( CGPoint
newCursorPosition );
or
CG_EXTERN CGEventErr CGPostMouseEvent( CGPoint mouseCursorPosition,
boolean_t
updateMouseCursorPosition,
CGButtonCount buttonCount,
boolean_t mouseButtonDown, ... );
according to the operation you want to perform.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.