<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGEventType",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@E@CGEventType"
  },
  "title" : "CGEventType"
}
-->

# CGEventType

Constants that specify the different types of input events.

```
enum CGEventType
```

## Overview

These constants are used:

- In the functions [`tapCreate(tap:place:options:eventsOfInterest:callback:userInfo:)`](/documentation/CoreGraphics/CGEvent/tapCreate(tap:place:options:eventsOfInterest:callback:userInfo:)) and [`tapCreateForPSN(processSerialNumber:place:options:eventsOfInterest:callback:userInfo:)`](/documentation/CoreGraphics/CGEvent/tapCreateForPSN(processSerialNumber:place:options:eventsOfInterest:callback:userInfo:)) to specify the events of interest for the new event tap.
- To indicate the event type passed to your event tap callback function.
- In the function [`init(mouseEventSource:mouseType:mouseCursorPosition:mouseButton:)`](/documentation/CoreGraphics/CGEvent/init(mouseEventSource:mouseType:mouseCursorPosition:mouseButton:)) to specify the type of mouse event.
- In the functions [`type`](/documentation/CoreGraphics/CGEvent/type) and [`CGEventSetType`](/documentation/CoreGraphics/CGEventSetType) to identify the event type.
- In the functions [`counterForEventType(_:eventType:)`](/documentation/CoreGraphics/CGEventSource/counterForEventType(_:eventType:)) and [`secondsSinceLastEventType(_:eventType:)`](/documentation/CoreGraphics/CGEventSource/secondsSinceLastEventType(_:eventType:)) to indicate the event type.

Note that tablet devices may generate mouse events with embedded tablet data, or tablet pointer and proximity events. Tablet mouse events allow tablets to be used with applications that are not tablet-aware.

## Topics

### Constants

[`case null`](/documentation/CoreGraphics/CGEventType/null)

Specifies a null event.

[`case leftMouseDown`](/documentation/CoreGraphics/CGEventType/leftMouseDown)

Specifies a mouse down event with the left button.

[`case leftMouseUp`](/documentation/CoreGraphics/CGEventType/leftMouseUp)

Specifies a mouse up event with the left button.

[`case rightMouseDown`](/documentation/CoreGraphics/CGEventType/rightMouseDown)

Specifies a mouse down event with the right button.

[`case rightMouseUp`](/documentation/CoreGraphics/CGEventType/rightMouseUp)

Specifies a mouse up event with the right button.

[`case mouseMoved`](/documentation/CoreGraphics/CGEventType/mouseMoved)

Specifies a mouse moved event.

[`case leftMouseDragged`](/documentation/CoreGraphics/CGEventType/leftMouseDragged)

Specifies a mouse drag event with the left button down.

[`case rightMouseDragged`](/documentation/CoreGraphics/CGEventType/rightMouseDragged)

Specifies a mouse drag event with the right button down.

[`case keyDown`](/documentation/CoreGraphics/CGEventType/keyDown)

Specifies a key down event.

[`case keyUp`](/documentation/CoreGraphics/CGEventType/keyUp)

Specifies a key up event.

[`case flagsChanged`](/documentation/CoreGraphics/CGEventType/flagsChanged)

Specifies a key changed event for a modifier or status key.

[`case scrollWheel`](/documentation/CoreGraphics/CGEventType/scrollWheel)

Specifies a scroll wheel moved event.

[`case tabletPointer`](/documentation/CoreGraphics/CGEventType/tabletPointer)

Specifies a tablet pointer event.

[`case tabletProximity`](/documentation/CoreGraphics/CGEventType/tabletProximity)

Specifies a tablet proximity event.

[`case otherMouseDown`](/documentation/CoreGraphics/CGEventType/otherMouseDown)

Specifies a mouse down event with one of buttons 2-31.

[`case otherMouseUp`](/documentation/CoreGraphics/CGEventType/otherMouseUp)

Specifies a mouse up event with one of buttons 2-31.

[`case otherMouseDragged`](/documentation/CoreGraphics/CGEventType/otherMouseDragged)

Specifies a mouse drag event with one of buttons 2-31 down.

[`case tapDisabledByTimeout`](/documentation/CoreGraphics/CGEventType/tapDisabledByTimeout)

Specifies an event indicating the event tap is disabled because of timeout.

[`case tapDisabledByUserInput`](/documentation/CoreGraphics/CGEventType/tapDisabledByUserInput)

Specifies an event indicating the event tap is disabled because of user input.

### Initializers

[`init?(rawValue: UInt32)`](/documentation/CoreGraphics/CGEventType/init(rawValue:))

## Relationships

### Conforms To

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Sendable`](/documentation/Swift/Sendable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)