iBonzo said:
I wrote a tutorial on how to use Global Hotkeys in Cocoa.
Very cool, thanks a lot iBonzo! I don't have a need for this now, but I probably will someday.
Now, I have a somewhat related question for you all. I'm trying to have it so that I have hotkeys specific to a document window. For example, the space bar would toggle a pause/play method (independant for each document window). OK, so I have subclassed NSWindow and overridden keyDown: and that works fine. However, the problem is that I have editable text fields on this window, and as soon as I begin to edit one of the text fields, I lose my "window hotkeys" because it's stuck editing the text field. The text field will not resign editing (or focus, responder) status when I'm done editing (with return key). So how can I tell my app, or that document window at least, to end
all editing and "defocus" all UI objects? I found a few methods that looked like they might do that, but they didn't work as advertised. Do I have to do something painful like subclass every editable UI object to accomplish this?