As a newbie to Cocoa, I'm trying to understand why the general subclasses of NSResponder implement key events the way they look.
In my program, I have a subclass of NSWindow that takes up the entire screen and must necessarily handle key events. There are several basic commands that can change the entire state of the program (for example, pause the timer when the user falls into a space), which does not make sense to have subtasks, such as the NSTextField descriptor.
It seems to me that the delegate (controller) should receive these events. Instead, I find that I need to write a bunch of dirty glue code so that the window (through its selector keyDown:and interpretKeyEvents:) notifies the controller, or I just need to move the bunch of controller code to a subclass of NSWindow by itself.
It's dirty, and my gut tells me I'm missing something. Is there a cleaner solution?
EricB source
share