Re: -[NSResponder flagsChanged:] not called?
Re: -[NSResponder flagsChanged:] not called?
- Subject: Re: -[NSResponder flagsChanged:] not called?
- From: Matt Neuburg <email@hidden>
- Date: Wed, 12 Jun 2002 11:03:00 -0700
At 6:23 PM +0200 6/12/02, Marco Scheurer wrote:
>
On Wednesday, June 12, 2002, at 05:56 pm, Matt Neuburg wrote:
>
> On Tue, 11 Jun 2002 16:38:54 -0600 (MDT), Harold Cooper
>
> <email@hidden> said:
>
>
>
>> I've implemented the flagsChanged: message of NSResponder as
>
>> follows in my NSView subclass:
>
>>
>
>> - (void)flagsChanged:(NSEvent *)event
>
>> {
>
>> NSLog(@"flagsChanged:");
>
>> //...
>
>> }
>
>>
>
>> of course nothing is printed, nor is the omitted portion executed.
>
>
>
> Harold - flagsChanged works perfectly in my app. I suspect that your
>
> problem is that flagsChanged doesn't happen "in" any view, so you need
>
> to
>
> catch it in your NSWindow subclass; that's what I do, anyway. m.
>
>
Ahem. A NSWindow subclass is certainly not needed for that, a window
>
delegate will certainly catch these events if no one is doing this
>
before.
>
>
But in order to catch these events directly in your view, all you have
>
to do is to make sure that, like for other keyboard events, it is first
>
responder or in the responder chain.
Ahem yourself. Have you tested what you're saying? I have, and in my tests,
the firstResponder or window delegate does not catch this event; the window
subclass does. That is why I gave the response that I did.
Of course, if you have a project that proves otherwise, please send it to
me. I'd be happy to learn what I'm "certainly" doing wrong. m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes gar anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.