Contents

init(cgEvent:)

Creates and returns an event object for a Core Graphics event.

Declaration

init?(cgEvent: CGEvent)

Parameters

  • cgEvent:

    A Cgevent opaque type that represents an event.

Return Value

An autoreleased NSEvent object that is equivalent to cgEvent.

Discussion

The returned object retains the CGEventRef object (cgEvent) until it (the Objective-C object) is freed—it then releases the CGEventRef object. If no Cocoa event corresponds to the CGEventRef object, this method returns nil.

See Also

Related Documentation

Creating an event object