Contents

init(mouseEventSource:mouseType:mouseCursorPosition:mouseButton:)

Returns a new Quartz mouse event.

Declaration

init?(mouseEventSource source: CGEventSource?, mouseType: CGEventType, mouseCursorPosition: CGPoint, mouseButton: CGMouseButton)

Parameters

  • source:

    An event source taken from another event, or NULL.

  • mouseType:

    A mouse event type. Pass one of the constants listed in Cgeventtype.

  • mouseCursorPosition:

    The position of the mouse cursor in global coordinates.

  • mouseButton:

    The button that’s changing state. Pass one of the constants listed in Cgmousebutton. This parameter is ignored unless the mouseType parameter is kCGEventOtherMouseDown, kCGEventOtherMouseDragged, or kCGEventOtherMouseUp.

Return Value

A new mouse event, or NULL if the event could not be created. When you no longer need the event, you should release it using the function CFRelease.

See Also

Functions