• 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: Intercepting Some Keyboard Events for NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Intercepting Some Keyboard Events for NSTextView (From: John Nairn <email@hidden>)

  • Prev by Date: rotate a bezierpath
  • Next by Date: Re: OpenStep for Enterprises
  • Previous by thread: Intercepting Some Keyboard Events for NSTextView
  • Next by thread: Re: Intercepting Some Keyboard Events for NSTextView
  • Index(es):
    • Date
    • Thread