I'm trying to detect the enter key from a custom NSTextView (from a NSTextField completion list) but I can't get it to work.
My interface:
@interface PaddedTextView : NSTextView < NSTextViewDelegate >
I implement:
- (BOOL)textView:(NSTextView *)textView doCommandBySelector (SEL)commandSelector
{
But it is never called.
The Completion list disappears when I press enter after selecting an option.
I have also implemented:
- (void)keyDown:(NSEvent *)event
and it will detect alpha numeric key events but not the enter key.
I also have implemented flagsChanged to capture the shift key and that works.
I am using a custom NSTextField, NSTextFieldCell and NSTextView.
When I select a completion entry and hit the enter key the value will be inserted into the NSTextField control but I want to perform an action when this happens and I can't detect it...
Any help is appreciated. Thanks