• 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
Forcing the mouse cursor position
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Forcing the mouse cursor position


  • Subject: Forcing the mouse cursor position
  • From: Shawn Seet <email@hidden>
  • Date: Wed, 9 Mar 2005 22:52:05 +1100

Hi All
I'm playing around with an app that involves drawing rectangles by dragging the mouse across a view. Simple, I know, but I have tried to create behavior similar to apps like Photoshop where holding the shift key down forces the axes to remain at a constant ratio. In this case I am making them the same, ie squares. That was straightforward but it seemed a llittle inelegant that the cursor didn't track with the vertex of the square.
So I tried forcing the issue... using CGWarpMousecursorPosition(). Where I have come a cropper is converting the NSPoint of the mouse's current position to a CGPoint to uses as an argument for the function.
Is CGPoint's ref system the same as NSPoint's (WRT the screen)? The documentation suggests so. But my experience is that CGPoint's origin is top left not bottom left.


Does anyone have any thoughts about this or pointers to sample code which might elucidate? Maybe I'm barking up the wrong tree trying to force the cursor's position.
thank you
shawn


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Forcing the mouse cursor position
      • From: Andy Armstrong <email@hidden>
  • Prev by Date: Re: NSEnumerator retaining objects?
  • Next by Date: How to create a window with a border
  • Previous by thread: Re: Drop files on NSTextView and Controllers
  • Next by thread: Re: Forcing the mouse cursor position
  • Index(es):
    • Date
    • Thread