• 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? [As an event?]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting keyDown in a NSTextField? [As an event?]


  • Subject: Re: Detecting keyDown in a NSTextField? [As an event?]
  • From: "Jean-Olivier Lanctôt-D." <email@hidden>
  • Date: Wed, 8 Oct 2003 06:55:21 -0400

Yes, but there MUST be a way to intercept the event?!

controlTextDidChange will not tell me about keys that don't convert as characters....

I want to know when tab or left, right, up, down are pushed... there must be a way?

Thanks!

On Wednesday, October 8, 2003, at 01:35 AM, Henry McGilton wrote:

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.
_______________________________________________
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: 
 >Re: Detecting keyDown in a NSTextField? (From: Henry McGilton <email@hidden>)

  • Prev by Date: Re: help : cocoa
  • Next by Date: Re: help : cocoa
  • Previous by thread: Re: Detecting keyDown in a NSTextField?
  • Next by thread: Re: Detecting keyDown in a NSTextField?
  • Index(es):
    • Date
    • Thread