• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSResponder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSResponder


  • Subject: Re: NSResponder
  • From: Greg Hulands <email@hidden>
  • Date: Wed, 24 Sep 2003 09:30:51 +1000

Whereabouts in the responder chain have you put CmdResponder? It maybe
easier to subclass NSApplication (which it is a subclass of
NSResponder) to catch the flags changed event. Reading the - (void)
interpretKeyEvents: (NSArray *) eventArray documentation maybe of help
to you as well.

HTH,
Greg
On Wednesday, September 24, 2003, at 06:34 AM, Daniel Todd Currie wrote:

> This doesn't seem to work either (I did add acceptsFirstResponder to
> CmdResponder.h, even though Ryan's response doesn't explicitly say
> to). Is this NSLog even a valid test?
>
>
> On Tuesday, September 23, 2003, at 06:48 AM, Ryan Stevens wrote:
>
>> On Tuesday, September 23, 2003, at 02:01 AM, Daniel Todd Currie
>> wrote:
>>
>>> I'm trying to get my app to respond to a press or release of the
>>> command key alone. I've subclassed NSResponder as follows:
>>>
>>> CmdResponder.h:
>>>
>>> @interface CmdResponder : NSResponder
>>> {
>>> }
>>> - (void)flagsChanged:(NSEvent *)theEvent;
>>> @end
>>>
>>>
>>> CmdResponder.m:
>>>
>>> @implementation CmdResponder
>>>
>> - (BOOL)acceptsFirstResponder
>> {
>> return YES;
>> }
>>
>>> - (void)flagsChanged:(NSEvent *)theEvent
>>> {
>>> NSLog(@"responder active");
>>> }
>>>
>>> This is obviously just a simple test, but from here I can work the
>>> rest out. However, the @"responder active" message never appears in
>>> the run log. I've never done much with responders and this seems to
>>> be exactly how it is done in the DotView example (for mouse clicks).
>>> Any tips?
>>>
>>> Thanks.
>>>
>>
>> :-)
> _______________________________________________
> 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.
_______________________________________________
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.

References: 
 >Re: NSResponder (From: Daniel Todd Currie <email@hidden>)

  • Prev by Date: Silly question: Company name
  • Next by Date: NSTextFieldCell subclass
  • Previous by thread: Re: NSResponder
  • Next by thread: IB and foundation collections (was: IB problem)
  • Index(es):
    • Date
    • Thread