Contents

sendEvent(_:)

Dispatches an event to other objects.

Declaration

func sendEvent(_ event: NSEvent)

Parameters

  • event:

    The event object to dispatch.

Discussion

You rarely invoke sendEvent(_:) directly, although you might want to override this method to perform some action on every event. sendEvent(_:) messages are sent from the main event loop (the run() method). sendEvent(_:) is the method that dispatches events to the appropriate responders—NSApp handles app events, the NSWindow object indicated in the event record handles window-related events, and mouse and key events are forwarded to the appropriate NSWindow object for further dispatching.

See Also

Managing the event loop