Catching key events in NSTextField
Catching key events in NSTextField
- Subject: Catching key events in NSTextField
- From: Pierre-Olivier Latour <email@hidden>
- Date: Sun, 21 Jul 2002 13:04:37 +0200
Hi,
I'm currently writing a subclass of NSTextField to add autocomplete
functionality. I have installed a notification to
"NSControlTextDidChangeNotification" in which I do the autocompletion. It
works fine, but I still need to prevent autocompletion when the user press a
non-character key e.g. Return key, tab key, forward and backward delete,
etc...
My problem is that I can't intercept key events that come into the
NSTextField. Altough, it inherits from NSResponder and NSControl, neither
keydown: or even deleteBackward:, insertText: and so on are called if I
attempt to create them in my subclass.
How come? And what should I do? Subclassing the window's NSText field editor
seems rather complicated...
_____________________________________________________________
Pierre-Olivier Latour email@hidden
Lausanne, Switzerland
http://www.pol-online.net
_______________________________________________
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.