• 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: Handling NSTextField keyboard events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling NSTextField keyboard events


  • Subject: Re: Handling NSTextField keyboard events
  • From: Yann Bizeul <email@hidden>
  • Date: Mon, 31 May 2004 11:31:20 +0200

Instead of keyDown, try using

- (BOOL)performKeyEquivalent:(NSEvent *)theEvent

since arrow keys are special keys not handled by keyDown.

Subclass this in your NSTextField subclass and that should work

Best regards,

Le 31 mai 04, ` 08:37, William LeFevre a icrit :

> Hello,
> I'm creating a small application for calculating monthly mortgage
> payments. The application uses a number of NSTextFields, all of which
> are used to input numerical values. The default behavior for the up
> and down arrows is to move the insertion point to the beginning and
> end of the current string. I would like to override this behavior to
> instead increment and decrement the value.
> I'm at loss. I can't find a delegate which looks appropriate.
> Subclassing NSTextField and overriding keyDown: doesn't work because
> the text field isn't the first responder. My current suspicion is that
> I need to create a custom field editor which looks like a scary
> proposition.
> Can anyone point me in the right direction?
>
> Thanks,
> William
> _______________________________________________
> 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.
>
>
>
--
Yann Bizeul - yann at tynsoe.org
http://projects.tynsoe.org/
_______________________________________________
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: 
 >Handling NSTextField keyboard events (From: William LeFevre <email@hidden>)

  • Prev by Date: Re: Determinating iChat status
  • Next by Date: Re: Window won't show a second time.
  • Previous by thread: Handling NSTextField keyboard events
  • Next by thread: Determinating iChat status
  • Index(es):
    • Date
    • Thread