Type Method

enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:

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

Declaration

+ (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;

Parameters

type

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

location

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

flags

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

time

The time the event occurred in seconds since system startup.

windowNum

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

context

The display graphics context of the event.

eventNumber

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

trackingNumber

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

userData

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.