Instance Method

nextEvent(matching:until:inMode:dequeue:)

Forwards the message to the global NSApplication object, NSApp.

Declaration

func nextEvent(matching mask: NSEvent.EventTypeMask, until expiration: Date?, inMode mode: RunLoop.Mode, dequeue deqFlag: Bool) -> NSEvent?

Parameters

mask

The mask that the event to return must match.

expiration

The date until which to wait for events.

mode

The run loop mode to use while waiting for events

deqFlag

true to remove the returned event from the event queue; false to leave the returned event in the queue.

Return Value

The next event whose mask matches the specified mask; nil when no matching event was found.

See Also

Handling Events

class func menuChanged(NSMenu)

This method does nothing; it is here for backward compatibility.

Deprecated
var currentEvent: NSEvent?

The event currently being processed by the application.

func nextEvent(matching: NSEvent.EventTypeMask) -> NSEvent?

Returns the next event matching a given mask.

func discardEvents(matching: NSEvent.EventTypeMask, before: NSEvent?)

Forwards the message to the NSApplication object, NSApp.

func postEvent(NSEvent, atStart: Bool)

Forwards the message to the global NSApplication object, NSApp.

func sendEvent(NSEvent)

This action method dispatches mouse and keyboard events sent to the window by the NSApplication object.

func tryToPerform(Selector, with: Any?) -> Bool

Dispatches action messages with a given argument.