nextEvent(matching:)
Returns the next event matching a given mask.
Declaration
func nextEvent(matching mask: NSEvent.EventTypeMask) -> NSEvent?Parameters
- mask:
The mask that the event to return must match. Events with non-matching masks are left in the queue. See Discardevents(matching:before:) in Nsapplication for the list of mask values.
Return Value
The next event whose mask matches mask; nil when no matching event was found.
Discussion
This method calls the nextEvent(matching:until:inMode:dequeue:) method, where the matching mask parameter is the specified mask, the until (Swift) or untilDate (Objective-C) parameter is distantFuture, the inMode parameter is NSEventTrackingRunLoopMode, and the dequeue parameter is true.