Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个嵌入 WebView 的 Cocoa 应用程序。我想截取一个键盘快捷键,以便我可以在 WebView 中执行操作。
我不想为此操作实现菜单项。事实上,理想情况下,我只希望在用户位于 WebView 的文本区域框中时应用此快捷方式。
如何捕捉键盘快捷键以便将其传递给我的 WebView?
您可以让响应者链中更高的东西先处理它,或者如果没有削减它,则使用 CGEventTap。