• 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: j o a r <email@hidden>
  • Date: Mon, 16 May 2005 22:27:41 +0200


On 16 maj 2005, at 21.50, Sean McBride wrote:

Those constant names are very confusing! I've never seen a Mac keyboard
with a 'backspace' key, but I'm guessing NeXTs did have them. Anyway, I
think you may be confusing 'keys' and 'characters'.

Possibly, but I'm mostly confused with their names, or lack thereof...

I notice that the following are in NSEvent.h:
NSDeleteFunctionKey, NSDeleteCharFunctionKey, NSDeleteLineFunctionKey

and the following are in NSText.h:
NSBackspaceCharacter, NSDeleteCharacter

I think keys map to chars (and this depends on the user's keybindings!)

So the key that doesn't have a defined name, the key that I thought was called "backspace", maps to "NSDeleteCharacter". And the NSDeleteFunctionKey maps to a character that doesn't have a defined name, but with the same value as NSDeleteFunctionKey itself. Not exactly crystal clear... I have working code, but I'm not happy about it being so much based on trial-and-error.


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)!


But I'm not sure about any of this, but no one else replied. :)

I'm grateful for your reply!

j o a r


Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

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