Re: Intercepting Some Keyboard Events for NSTextView
Re: Intercepting Some Keyboard Events for NSTextView
- Subject: Re: Intercepting Some Keyboard Events for NSTextView
- From: Jonathan Jackel <email@hidden>
- Date: Sun, 14 Jul 2002 20:39:36 -0400
Subclass NSTextView in PB.
In IB, grab a Custom View from the Containers pallete. Position it the way
you want, select it, and pull up its inspector. Choose Attributes, and
select your subclass from the list of classes.
Jonathan
on 7/14/02 7:01 PM, John Nairn at email@hidden wrote:
>
I read about key board events in all books and the brief Apple
>
documentation, but I can not handle what I want and it should be easy.
>
>
My app has several NSTextViews and NSTextFields. I want to intercept
>
keyboard events for special characters is some of them, but what I have
>
tried does not work. For example:
>
>
1. I made a custom NSWindow class. It only get keyboard events when it
>
is the first responder, but I need to select first responders by
>
clicking around fields, selecting with mouse, etc.
>
>
2. I made a custom subclass to NSScrollView containing an NSTextView,
>
but apparently the keyboard event goes directly to the NSTextView.
>
>
3. I tried to make a cusom class for the NSTextView (which sounds like
>
the best way to me), but Interface Builder says that custom class is not
>
application for an NSTextView.
>
>
The only thing I can think of is to us a custom NSWindow class as always
>
being the first responder, but then it seems like there will be a lot of
>
work handling flow of key board events to the right objects and then how
>
to control focus appearance, selections, and much more?
>
>
-----------------------
>
John Nairn
>
email@hidden
>
http://www.mse.utah.edu/~nairn
>
-----------------------
>
_______________________________________________
>
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.