Re: Filtering all keyboard input in an NSTextView
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.