• 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 keydowns
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: intercepting keydowns


  • Subject: Re: intercepting keydowns
  • From: Satoshi Matsumoto <email@hidden>
  • Date: Sun, 03 Apr 2005 05:35:37 +0900

on 05.4.3 1:59 AM, Roland Silver at email@hidden wrote:
> I have a simple Cocoa application with a controller and a window with
> an NSTextView. I want to intercept keydown events on their way to the
> text view, process them with a function or method, and send a possibly
> different keydown event on to the text view.
> Nothing I try works.
> Any suggestions?

Subclass NSTextView and override following method.

- (void)keyDown:(NSEvent *)theEvent

And if you wish to intercept  all key events including all menu short cuts,
subclass NSApplication and override following method.

- (void)sendEvent:(NSEvent *)theEvent

Satoshi
-----------------------------------------------------
Satoshi Matsumoto <email@hidden>
816-5 Odake, Odawara, Kanagawa, Japan 256-0802


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: intercepting keydowns
      • From: Douglas Davidson <email@hidden>
    • Re: intercepting keydowns
      • From: Roland Silver <email@hidden>
References: 
 >intercepting keydowns (From: Roland Silver <email@hidden>)

  • Prev by Date: Keychain
  • Next by Date: .Mac PrefPane's QuotaBar
  • Previous by thread: Re: intercepting keydowns
  • Next by thread: Re: intercepting keydowns
  • Index(es):
    • Date
    • Thread