• 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: NSDeleteCharacter when expected NSBackspaceCharacter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDeleteCharacter when expected NSBackspaceCharacter


  • Subject: Re: NSDeleteCharacter when expected NSBackspaceCharacter
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 16 May 2005 13:37:40 -0700


On May 16, 2005, at 1:27 PM, j o a r wrote:

Maybe your NSTableView subclass can implement deleteBackward: and

deleteForward: instead? I think that would be best. Otherwise testing

chars is probably better than testing raw keys.



It would have been great if that had worked, but I think that these methods are only called automatically from the text system. It would have been great to not have to subclass at all, and just implement a delegate method, something like "control:(textView:)doCommandBySelector:" (but without the text view of course)!



NSTextView does provide this, but it isn't magic; it's done by calling [self interpretKeyEvents:] in keyDown:.  That ends up eventually calling either insertText: or doCommandBySelector:.  The whole apparatus of key handling, including not just key binding but also input managers, is available to custom classes that wish to make use of it.  It's intended primarily for text editing, of course, but I don't see offhand why other uses would not be possible.

Douglas Davidson
 
 _______________________________________________
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: NSDeleteCharacter when expected NSBackspaceCharacter
      • From: j o a r <email@hidden>
References: 
 >NSDeleteCharacter when expected NSBackspaceCharacter (From: j o a r <email@hidden>)
 >Re: NSDeleteCharacter when expected NSBackspaceCharacter (From: "Sean McBride" <email@hidden>)
 >Re: NSDeleteCharacter when expected NSBackspaceCharacter (From: j o a r <email@hidden>)

  • Prev by Date: Re: From Panther to Tiger
  • Next by Date: Re: NSDeleteCharacter when expected NSBackspaceCharacter
  • Previous by thread: Re: NSDeleteCharacter when expected NSBackspaceCharacter
  • Next by thread: Re: NSDeleteCharacter when expected NSBackspaceCharacter
  • Index(es):
    • Date
    • Thread