Type Method

eventWithEventRef:

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

Declaration

+ (NSEvent *)eventWithEventRef:(const void *)eventRef;

Parameters

eventRef

The EventRef opaque type to be associated with the created NSEvent object.

Return Value

An autoreleased NSEvent object corresponding to eventRef or nil if eventRef cannot be converted into an equivalent NSEvent object.

Discussion

This method is valid for all events. The created NSEvent object retains the EventRef object and is released when the NSEvent object is freed.

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.

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

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

+ eventWithCGEvent:

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