Right way to make controller react on space key event
Im making an application where i got a cue list, and some other views around it. When the user presses Space, i want the next cue to play. No matter what view is first responder, unless its a textfield. So even though ano开发者_运维百科ther table is selected, i want the cue to get played.
I have made a custom class that acts as cue controller, this is where the actual "go" code is.
My question is, how should i make my custom cue controller always listening to the space? Can't really find out what I should do.
Hope somebody can help me.
You want to watch WWDC 2010 session 145. (Even if you didn't go to WWDC, you should have access—Apple granted access to everybody this year.) It'll tell you everything you need to know about the many ways to handle a keypress.
Every Mac developer should watch that session.
精彩评论