• 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: Filtering all keyboard input in an NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filtering all keyboard input in an NSTextView


  • Subject: Re: Filtering all keyboard input in an NSTextView
  • From: email@hidden
  • Date: Fri, 15 Mar 2002 18:16:52 -0800

All command key events are processed by menu items way before the event
reaches your object.
In order to filter these events, you need to override -[NSApplication
sendEvent:].

Umph. That won't work for us, unfortunately -- the code in question is a
sheet window running from inside a bundle which is loaded by another
application (System Preferences, to be precise...), and as such have no
direct control over the NSApplication object instance or the parent window
instance we're running under.

Overriding performMnemonic:, which someone else suggested, didn't do the job
either.

Any other suggestions? This one is a real pain in my neck right now...

Hmm. Sounds to me like you might want to be running loop in which you call -[NSApp nextEventMatchingMask:untilDate:inMode:dequeue:]. I've never tried doing that with keyboard events, only with mouse-tracking loops, but I think it ought to work...

Ben Haller
Stick Software
_______________________________________________
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.

  • Prev by Date: Re: Leak in NSData +dataWithContentsOfURL:
  • Next by Date: Re: SOLVED: Workaround to force painting of NSSplitView's
  • Previous by thread: Re: Filtering all keyboard input in an NSTextView
  • Next by thread: Disable anti-aliasing in NSTextView?
  • Index(es):
    • Date
    • Thread