In the application I’m writing I need to be able to register when the user moves the pointer. To do this I have made use of the NSEvent class method addGlobalMonitorForEventsMatchingMask:handler:. This works fine when the program is running in a window on the desktop. However when I make the application fullscreen, by use of the NSView enterFullScreenMode:withOptions: method, the event handler is no longer called. Could someone explain why this is the case, and what I can do to remedy the situation?
In the application I’m writing I need to be able to register when the
Share
The description of
addGlobalMonitorForEventsMatchingMask:handler:says it only “receives copies of events posted to other applications”.When your application takes over the entire screen, other applications no longer “see” the mouse movement events.
In other words, you could probably “change over” to using
addLocalMonitorForEventsMatchingMask:handler:when your app moves to fullscreen.