按Shift键时如何通知?
解决方法 从 Cocoa事件处理指南:The flagsChanged: method can be useful for detecting the pressing of modifIEr keys without any other key being pressed simultaneously. For example,if the user presses the Option key by itself,your responder object can detect this in its implementation of flagsChanged:.
更多细节可以找到here.
NSResponder的文档还说明如下:
总结flagsChanged:
Informs the receiver that the user has pressed or released a modifIEr key (Shift,Control,and so on).
— (voID)flagsChanged:(NSEvent *)theEvent
以上是内存溢出为你收集整理的osx – 如何检测到按下Shift键?全部内容,希望文章能够帮你解决osx – 如何检测到按下Shift键?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)