可可:将鼠标限制为屏幕

我正在为OSX开发一个kiosk模式应用程序。在某些情况下,会附加另一个屏幕。我的应用程序在一个屏幕上以全屏模式运行:
[self.window.contentView enterFullScreenMode:s 
                                 withOptions:[NSDictionary dictionaryWithObject:appOptions
                                      forKey:NSFullScreenModeApplicationPresentationOptions]];
选项如下:
[NSNumber numberWithUnsignedInt:(NSApplicationPresentationHideMenuBar|
                                NSApplicationPresentationHideDock|
                                 NSApplicationPresentationDisableHideApplication|
                                 NSApplicationPresentationDisableProcessSwitching|
                                 NSApplicationPresentationDisableAppleMenu)];
我想要的是将鼠标光标限制在游戏运行的屏幕上。 我怎么能做到这一点?     
已邀请:
将NSTrackingArea添加到您不希望鼠标进入的屏幕。当您收到鼠标已进入跟踪区域的通知时,请使用CGEventCreateMouseEvent和CGPostEvent将鼠标移回安全位置,可能是主屏幕上最近的点。     

要回复问题请先登录注册