Re: NSView directly drawn on screen?
Re: NSView directly drawn on screen?
- Subject: Re: NSView directly drawn on screen?
- From: John Ku <email@hidden>
- Date: Sun, 14 Jun 2009 23:44:04 -0700
Thank you!! I just tried experimenting with those codes and it somewhat
works. The 'Main' window doesn't switch now and I get two insertion point
'Key' in both my app and the current running application. Its like the
Finder & Spotlight experiment you mentioned. But thank you for giving me
alead. At least now I can eliminate some other non-related problems.
I'll post the solution if I ever find it though.
Cheers!
John
On Sun, Jun 14, 2009 at 7:31 PM, Peter N Lewis <email@hidden>wrote:
> On 13/06/2009, at 16:51 , Michael Ash wrote:
>
>> You can't. If you want to receive keyboard events then you must have
>> focus. If you don't want to have focus, then you can't receive
>> keyboard events. Pick one or the other, because you can't have both.
>>
>
> Well, technically you could use an event tap or some similar mechanism.
> Almost never the right choice, but only almost never.
>
> On 14/06/2009, at 6:29 , Uli Kusterer wrote:
>
>> Not true. Spotlight removes keyboard focus from the front app. Try it in
>> Mail: Put the cursor in the "Subject" text field so it gets the blue focus
>> border. Pull down the Spotlight menu. The focus border goes away and
>> Spotlight's search field gets the insertion mark.
>>
>
> Except, try the same thing in the Finder. Put the cursor in the
> "Spotlight" search field so it gets the blue focus border. Pull down the
> Spotlight menu. The focus border on the original Spotlight search field
> remains. You even get two flashing insertion cursors. That's very weird.
>
> As Andy suggests, I suspect what you need is a floating panel window, with
> canBecomeKeyWindow returning YES and canBecomeMainWindow returning NO, a
> window level set to something appropriate (possibly NSFloatingWindowLevel or
> NSStatusWindowLevel). You may also want to look at:
>
> [self setBecomesKeyOnlyIfNeeded:NO];
> [self setFloatingPanel:YES];
> [self setWorksWhenModal:YES];
>
> and
>
> - (void)makeKeyAndOrderFront:(id)sender
> {
> [NSApp activateIgnoringOtherApps:YES];
> [super makeKeyAndOrderFront:sender];
> [NSApp activateIgnoringOtherApps:NO];
> }
>
> And heaven help you if you are running a Carbon run loop and have a
> borderless window.
>
> Enjoy,
> Peter.
>
>
> --
> Clipboard Switching and Macros with Keyboard Maestro
>
> Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
> <http://www.stairways.com/> <http://download.stairways.com/>
>
>
>
>
> _______________________________________________
>
> 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
>
_______________________________________________
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