• 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
Custom NSTextField & keyDown:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Custom NSTextField & keyDown:
      • From: Douglas Davidson <email@hidden>
    • Re: Custom NSTextField & keyDown:
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: NSTextField Focus
  • Next by Date: Re: [ANN] Internet Services for the rest of us
  • Previous by thread: Re: iTunes feature: OT
  • Next by thread: Re: Custom NSTextField & keyDown:
  • Index(es):
    • Date
    • Thread