objective-cuser-interfacecocoauiwindowkeywindow

Whats a key window in Objective-C Cocoa?


What is a key window? And what is it used for? I read its used for "key input";but could someone expand on this? An example would be appreciated.


Solution

  • The "key window" is the window that is currently accepting mouse and keyboard events. Usually the main window and the key window are the same, but that's not necessarily true (for example, if you have a utility window open, it can't be the main window, but it may become the key window).