• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Setting cursor Position
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting cursor Position


  • Subject: Re: Setting cursor Position
  • From: j o a r <email@hidden>
  • Date: Fri, 15 Aug 2003 18:02:25 +0200

Look at CGRemoteOperation.h. For example:

#import <ApplicationServices/ApplicationServices.h>

CGDisplayErr err;
if ((err = CGWarpMouseCursorPosition(CGPointMake(screenPoint.x, screenPoint.y))) != CGEventNoErr)
{
NSLog(@"CGWarpMouseCursorPosition returned: \"%d\"", err);
}

...where screenPoint is an NSPoint in screen coordinates.

j o a r

On den 15 augusti 2003, at 17:39:05PM, Darrel Anderson wrote:

I'm looking for a way to programmatically set the cursor position in a Cocoa
app.

I found the IOFBSetCursorPosition stuff, but as usual, was wondering if
there are any higher level options. Short of that, any sample code that
shows the proper use of IOFBSetCursorPosition would be very helpful.

I'm setting up a UI where the user alters variables by moving the mouse
within a view, and need the cursor to "wrap" (ex. have the cursor reappear
on the right edge of the view when it exits left).
_______________________________________________
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.

  • Follow-Ups:
    • Re: Setting cursor Position
      • From: Darrel Anderson <email@hidden>
References: 
 >Setting cursor Position (From: Darrel Anderson <email@hidden>)

  • Prev by Date: Vermont Recipes...
  • Next by Date: Re: Dynamic menu building
  • Previous by thread: Setting cursor Position
  • Next by thread: Re: Setting cursor Position
  • Index(es):
    • Date
    • Thread