Forcing the mouse cursor position
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