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: Steve Bennett <email@hidden>
- Date: Fri, 15 Mar 2002 17:30:38 -0500
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...
-->Steve Bennett
on 3/14/02 8:09 PM, Aki Inoue at email@hidden wrote:
>
Steve,
>
>
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:].
>
>
Aki
>
>
On 2002.03.14, at 15:23, Steve Bennett wrote:
>
>
> Hi!
>
>
>
> Here's a weird one. I'm not going to go into the reasons (they're
>
> really
>
> complex), but I need to have an NSTextView which on occation filters
>
> ALL of
>
> it's incoming keystrokes through my own handler, including all Command
>
> key
>
> sequences.
>
>
>
> Now, I've tried my own subclass of NSTextView which overrides keyDown,
>
> and
>
> that works just peachy EXCEPT... Command key sequences still try to do
>
> their
>
> thing without running through keyDown first. Any suggestions on how I
>
> can
>
> filter those as well, at least the ones which make it to the
>
> application?
>
> (I'm aware some command key sequences are processed by the OS --
>
> nothing I
>
> can do about those...)
>
>
>
> -->Steve Bennett
>
> _______________________________________________
>
> 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.