Custom NSTextField & keyDown:
Custom NSTextField & keyDown:
- Subject: Custom NSTextField & keyDown:
- From: Ryan McGann <email@hidden>
- Date: Sat, 21 Sep 2002 20:26:40 -0700
I asked this question before, but I thought I'd give it another shot.
I'm writing an application which allows the user to assign custom key
combinations to various tasks. In order to assign the "hotkey" the user
enters it in an NSTextField. I want the text field to show all the
modifiers and characters that were used in the hotkey, so pressing
command-shift-five displays cmd-shift-5, not cmd-shift-%.
Several problems:
- My subclass of NSTextField is definitely being instantiated (its
awakeFromNib method is called), but its keyDown: method is not being
called. If I change it to keyUp: I get called, but this is too late.
- I need to convert the key code into a character. In Carbon I can
call KeyTranslate. What's the similar functionality in Cocoa?
- I need to capture the key strokes before command key binding is
doneI want the user to be able to use the command key as a modifier
key.
- How do I stop the caret from blinking, without stopping the
NSTextField from becoming the first responder?
Thanks,
Ryan
email@hidden
_______________________________________________
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.