• 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: Making a NSFormatter receive special keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making a NSFormatter receive special keys


  • Subject: Re: Making a NSFormatter receive special keys
  • From: Ali Lalani (list) <email@hidden>
  • Date: Fri, 23 Aug 2002 15:08:57 -0400

On Friday, August 23, 2002, at 02:26 Uhr, Douglas Davidson wrote:

On Friday, August 23, 2002, at 10:28 AM, Clark S. Cox III wrote:

Is there a proper way to make a NSFormatter connected to a text editor
receive special keys like F1, up arrow, etc... When the user presses them?

No, NSFormatters simply format and validate whatever is contained inside
a control/cell, they don't ever directly get the keys that the user is
pressing, that is the control/cell's job.

Yes, it would usually be the job of the control or text view's delegate instead, via such methods as

- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;


I'm not sure if this is the solution you're looking for, but i have implemented a subclass of NSFormatter and captured special keys, in this case to see if the Option key was pressed in combination with another key. You can do this by calling [NSApp currentEvent] which will return you an NSEvent instance from which you can determine exactly what keys were pressed...hope this helps :)

Ali Lalani
e-mail: email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: Making a NSFormatter receive special keys
      • From: Pierre-Olivier Latour <email@hidden>
References: 
 >Re: Making a NSFormatter receive special keys (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: Making a NSFormatter receive special keys
  • Next by Date: Static variable intiialization (Was: Re: EXC_BAD_ACCESS in an strange place)
  • Previous by thread: Re: Making a NSFormatter receive special keys
  • Next by thread: Re: Making a NSFormatter receive special keys
  • Index(es):
    • Date
    • Thread