What is the message flow of command+q on a Mac
I am building a mac application in cocoa and would like to know what is the message flow (method calls) when the 开发者_Python百科user presses command+q. The app uses the document based architecture.
Thanks.
Apple explained this completely in WWDC 2010 session 145: http://developer.apple.com/videos/wwdc/2010/
You don't need to have attended WWDC to have access to it; the session videos are free to everybody with an ADC account this year.
It goes up the responder chain like every other key press. If the first responder cannot or does not want to handle it, it gets passed up to the next in line. Usually for that key combination, the NSApplication
instance recognizes it, handles it and consumes it.
精彩评论