什么是Objective-C Cocoa的关键窗口?

时间:2023-01-02 20:01:15

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.

什么是关键窗口?它用于什么?我读它用于“键输入”;但有人可以扩展这个吗?一个例子将不胜感激。

1 个解决方案

#1


29  

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).

“关键窗口”是当前正在接受鼠标和键盘事件的窗口。通常主窗口和关键窗口是相同的,但这不一定是真的(例如,如果您打开实用程序窗口,它不能是主窗口,但它可能成为关键窗口)。

#1


29  

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).

“关键窗口”是当前正在接受鼠标和键盘事件的窗口。通常主窗口和关键窗口是相同的,但这不一定是真的(例如,如果您打开实用程序窗口,它不能是主窗口,但它可能成为关键窗口)。