macoscocoawebviewtextfieldkeystrokes

Cocoa webview textfield not accepting keystrokes


I am a newbie in OSx development.

I have a Cocoa application which uses a Webview. Everything is working fine, except for the textfield in the webview. I know how to enable keystrokes in NSTextField, but not the ones in the Webview. I've been searching the web all day, but with no luck. I badly need some help on how to enable the keystrokes to implement keyboard shortcut keys.

Example:

copy -> command + c

paste -> command + v

cut -> command + x

Any help would be very much appreciated.


Solution

  • I got the answer now. I've realized that I forgot to implement

    - (BOOL)performKeyEquivalent:(NSEvent *)theEvent
    

    to the class which handles the Webview.