• 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: Detecting keyDown in a NSTextField?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting keyDown in a NSTextField?


  • Subject: Re: Detecting keyDown in a NSTextField?
  • From: Henry McGilton <email@hidden>
  • Date: Tue, 7 Oct 2003 22:35:11 -0700

On Tuesday, October 7, 2003, at 06:33 PM, Jean-Olivier Lancttt-D. wrote:

Hi List!

I have an NSTextField, and I want to be notified whenever a key gets pushed.

Normally, I'd go like that in my brain.

NSTextField is a NSView so it gets keyDown:

so I subclass keydown and NSLog something. but it never gets NSLogged.

I override acceptsFirstResponder to return YES, it doesnt work...

It's prolly because of the cell inside the view? But NSCell has no keyDown method...

So what do I do??

I'm a bit of a newbie when it comes to responder stuff... so please help me ;)

Look at the documentation for NSControl and see the delegate methods
controlTextDidBeginEditing, controlTextDidChange, and controlTextDidEndEditing.
Those are good starting points for figuring out when stuff is happening
in a text field.

Best Wishes,
........ Henry


===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
_______________________________________________
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.

  • Follow-Ups:
    • Re: Detecting keyDown in a NSTextField? [As an event?]
      • From: "Jean-Olivier Lanctôt-D." <email@hidden>
References: 
 >Detecting keyDown in a NSTextField? (From: "Jean-Olivier Lanctôt-D." <email@hidden>)

  • Prev by Date: Number formatting
  • Next by Date: Re: Number formatting
  • Previous by thread: Detecting keyDown in a NSTextField?
  • Next by thread: Re: Detecting keyDown in a NSTextField? [As an event?]
  • Index(es):
    • Date
    • Thread