Re: NSDeleteCharacter when expected NSBackspaceCharacter
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