Prevent 'not allowed' beep after keystroke in NSView

I think (but am not 100% certain, it's been a bit of time since I did this) you also need to override the NSView and/or NSResponder performKeyEquivalent: method. There, you'll return a YES to indicate to the caller that you did indeed handle the event.

And that will keep the "dooonk" sound from happening.


Instead of using keyUp:, you may want to use the moveUp: action, as it takes all of the hassle of determining which key to handle out of the mix. There are also similarly named routines for down and a variety for handling movement with selections, etc.

For further documentation on this, please see the Cocoa Event-Handling Guide, and in particular "Handling Keyboard Actions and Inserting Text", where it discusses the use of these commands in "Applications other that those that deal with text".

In particular, the other benefit to using these actions is that it avoids any problems with either key interpretation or special keyboards and keyboard layouts.