Returns the next event matching a given mask, or
nil if no such event is found before a specified expiration date.
- macOS 10.0+
The expiration date for the current event request. Specifying nil for this parameter is equivalent to returning a date object using the
The run loop mode in which to run while looking for events. The mode you specify also determines which timers and run-loop observers may fire while the app waits for the event.
YESif you want the event removed from the queue.
The event object whose type matches one of the event types specified by the
You can use this method to short circuit normal event dispatching and get your own events. For example, you may want to do this in response to a mouse-down event in order to track the mouse while its button is down. (In such an example, you would pass the appropriate event types for mouse-dragged and mouse-up events to the
mask parameter and specify the
NSEvent run loop mode.) Events that do not match one of the specified event types are left in the queue.
You can specify one of the run loop modes defined by AppKit or a custom run loop mode used specifically by your app. AppKit defines the following run-loop modes:
Run Loop Mode
Tracking Run Loop Mode
Panel Run Loop Mode