在 OSX 上的 Cocoa 中以全屏模式处理事件
我正在尝试向我的可可应用程序添加全屏支持,但在弄清楚如何处理事件方面遇到了一些麻烦。我使用 EnterFullScreenMode:withOptions: 方法进入全屏模式,但是当我这样做时, NSFullScreenWindow 似乎成为第一个响应者并接收事件。我对如何重写此类来处理键盘和鼠标事件感到困惑(我找不到方法来设置哪个类的窗口成为全屏窗口)。我完全偏离基地了吗?我应该使用其他方法来实现全屏模式吗?
I am trying to add full screen support to my cocoa application and I am having a little trouble figuring out how to handle events. I use the method enterFullScreenMode:withOptions: to get into full screen mode but when I do this it seems that a NSFullScreenWindow becomes the first responder and receives events. I am confused about how about be able to override this class to handle keyboard and mouse events (I could find no way to set what class of window becomes the full screen window). Am I totally off base? Should I use another method to achieve full screen mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过将全屏视图设置为第一响应者,我能够克服这个问题。
I was able to overcome this problem by making the view that became full the screen the first responder.