init(eventRef:)
Creates and returns a new event object for a Carbon event.
Declaration
init?(eventRef: UnsafeRawPointer)Parameters
- eventRef:
The
EventRefopaque type to be associated with the createdNSEventobject.
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
Related Documentation
Creating an event object
keyEvent(with:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:)mouseEvent(with:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:)enterExitEvent(with:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:)otherEvent(with:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:)init(cgEvent:)