• 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: RegEx in cocoa, and where to dl PB+IB?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RegEx in cocoa, and where to dl PB+IB?


  • Subject: Re: RegEx in cocoa, and where to dl PB+IB?
  • From: Cryx <email@hidden>
  • Date: Sat, 27 Apr 2002 21:37:26 -0500

On Saturday, April 27, 2002, at 09:17 PM, Joel Rosenblum wrote:
On an unrelated note, actually regarding programming this time, I subclassed NSScrollView so that I could override the keyDown message, but it doesn't get called when I press a key. If I change the name to "keyUp" it does get called, but I want it to get called on keyDown so that I can decide whether or not to allow the key to go through to the editfield. Anyone else ever run into this problem?

When the scroll view is selected, it hands off first responder to a field editor. Thus the field editor, not the view, receives the keyDown events. It's a rather irritating design in that it makes it difficult to filter raw key events.

If I recall correctly, you can receive delegate notifications when the window needs a field editor. You can use these to substitute your own editor subclass with a keyDown method. In my own case, it proved to be much simpler to use a plain NSTextField and catch the keyDown events.

Daryn
_______________________________________________
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: RegEx in cocoa, and where to dl PB+IB? (From: Joel Rosenblum <email@hidden>)

  • Prev by Date: Re: Re(8): C'mon Apple! DECIDE!
  • Next by Date: about OS 9 Installation
  • Previous by thread: Re: RegEx in cocoa, and where to dl PB+IB?
  • Next by thread: Re: RegEx in cocoa, and where to dl PB+IB?
  • Index(es):
    • Date
    • Thread