Type Method


Returns a new NSEvent object describing a tracking-rectangle or cursor-update event.


+ (NSEvent *)enterExitEventWithType:(NSEventType)type location:(NSPoint)location modifierFlags:(NSEventModifierFlags)flags timestamp:(NSTimeInterval)time windowNumber:(NSInteger)wNum context:(NSGraphicsContext *)unusedPassNil eventNumber:(NSInteger)eNum trackingNumber:(NSInteger)tNum userData:(void *)data;



One of the following event-type constants: NSMouseEntered, NSMouseExited, NSCursorUpdate. If the specified constant is not one of these, an NSInternalInconsistencyException is raised


The cursor location in the base coordinate system of the window specified by windowNum.


An integer bit field containing any of the modifier key masks described in Getting Unicode Values, combined using the C bitwise OR operator.


The time the event occurred in seconds since system startup.


An integer that identifies the window device associated with the event, which is associated with the NSWindow that will receive the event.


The display graphics context of the event.


An identifier for the new event. It’s normally taken from a counter for mouse events, which continually increases as the application runs.


A number that identifies the tracking rectangle. This identifier is the same as that returned by the NSView method addTrackingRect:owner:userData:assumeInside:.


Data arbitrarily associated with the tracking rectangle when it was set up using the NSView method addTrackingRect:owner:userData:assumeInside:.

Return Value

The created NSEvent object or nil if the object could not be created.

See Also

Creating Events

+ mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:

Returns a new NSEvent object describing a mouse-down, -up, -moved, or -dragged event.

+ eventWithEventRef:

Creates an event object that is based on a Carbon type of event.

+ eventWithCGEvent:

Creates and returns an event object that is based on a Core Graphics type of event.