Re: Hijacking NSCursor
Re: Hijacking NSCursor
- Subject: Re: Hijacking NSCursor
- From: Ricky Sharp <email@hidden>
- Date: Mon, 24 Jul 2006 14:46:33 -0500
On Monday, July 24, 2006, at 02:10PM, Drew McCormack <email@hidden> wrote:
>I'm working on an app that includes some screenshot functionality. It
>all works as planned, except for one thing: when the user command-
>tabs to another app, the cursor changes from the crosshair that I set
>to the cursor of the newly active app. I can still get the
>screenshot, but the cursor change annoys me.
>
>I see that Preview manages to keep the crosshair when you switch the
>active application, although it does seem to lose the crosshair if
>you switch applications twice (say, to another app, and then back to
>Preview). My question is: how does Preview keep the crosshair cursor
>when the active application changes the first time?
I would actually call that a bug. And, I believe it may be a bug in general and not just with Preview.
For the bug I filed a few months back, the cursor will not change if you launch an app such that the mouse cursor is positioned to where a tracking rect will be eventually placed. Moving off the tracking rect and back on, or moving to a different tracking rect will set the cursor appropriately. The cursor will then behave correctly as long as you stay within the app. I haven't really seen it show up when switching between apps though.
In terms of capturing the cursor in screenshots, the short answer is that you can't.
This question comes up from time to time and if you search the archives, you'll find the same answer. All I can say is to file an enhancement request to obtain an application's cursor image. But note that that can be quite complex. Sometimes applications use custom cursors. While NSCursor does support 64x64 cursors, apps that need larger cursors actually hide the real cursor and just move around an overlay window.
As a workaround, I've seen screenshot apps provide a canned list of cursor images that users can select to have in the resultant screenshot (e.g. arrow, hand).
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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