Re: Getting mouse cursor position
Re: Getting mouse cursor position
- Subject: Re: Getting mouse cursor position
- From: Nick <email@hidden>
- Date: Sat, 07 May 2011 02:07:23 +0300
Thanks, Now it constantly returns (0;0). Why would that happen at all?
Maybe i don't have enough permissions to read the cursor position?
(like, need to have some accessibility things enabled)?
2011/5/7 Nathan Sims <email@hidden>:
>
> On May 6, 2011, at 3:55 PM, eveningnick eveningnick wrote:
>
>> I tried to use method -hotSpot of NSCursor, but it returns
>>> sc x=-2057825613, y=0
>>
>> -(IBAction)timeHandler:(id)timer {
>> //NSCursor *sc = [NSCursor currentSystemCursor];
>> NSCursor *sc = [NSCursor currentCursor];
>> NSLog(@"sc x=%d, y=%d", [sc hotSpot].x, [sc hotSpot].y);
>> }
>> What may be wrong here?
>
> -hotspot returns an NSPoint:
>
> typedef struct _NSPoint {
> CGFloat x;
> CGFloat y;
> } NSPoint;
>
> Try using %f.
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden