How to close an NSWindow on Cmd+W without Menu Shortcut?

keyboard-shortcuts, keydown, nswindow, objective-c, xcode

Solution

Ultimately i've implemented the Close `menu item` in my Main Menu that sends `performClose` to `First Responder` and has the Cmd+W shortcut.

Problem

i'm porting a Windows application to Mac OS X Cocoa and it must be as similar as possible, so there is no "Close Window" Menu Item with a binded Shortcut in my menu. But still i would like to be able to close them by Cmd+W Shortcut, is there a way to do this without handling keyDown event?

Original source