Ctrl+V not working in NSTextField?

Discussion in 'Mac Programming' started by mkristain, Sep 24, 2011.

  1. mkristain macrumors regular

    Joined:
    Aug 18, 2011
    #1
    please help me in my application Ctrl+V not working in NSTextField.

    thanks.
     
  2. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
  3. mkristain thread starter macrumors regular

    Joined:
    Aug 18, 2011
    #3
    this also not working, and i am not using edit menu in my application.
     
  4. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #4
    That will be the reason why. What is meant to happen is that the Paste menu item has the Cmd+V shortcut. So when the user hits Cmd+V, it's that menu item that activates. It's tied to first responder, so it sends the paste message to the first responder pseudo-object. This triggers a paste message propagating through the responder chain.

    Really you should have an edit menu. Users expect it and it's the easiest way to make Cmd+V work.

    If you refuse to have an edit menu, then you'll need to add manual keyboard event. Read the Cocoa Event-Handling Guide, in particular the Handling Key Events chapter, but only after having read the first 3 chapters.
     
  5. mkristain thread starter macrumors regular

    Joined:
    Aug 18, 2011

Share This Page