<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSEvent/data1",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSEvent(py)data1"
  },
  "title" : "data1"
}
-->

# data1

Additional data associated with this event.

```
var data1: Int { get }
```

## Discussion

The originator of the event defines the data in this property, and the data is dependent on the event type. If the type of this event isn’t  [`NSAppKitDefined`](/documentation/AppKit/NSAppKitDefined), [`NSSystemDefined`](/documentation/AppKit/NSSystemDefined), [`NSApplicationDefined`](/documentation/AppKit/NSApplicationDefined), or [`NSPeriodic`](/documentation/AppKit/NSPeriodic), accessing this property raises <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/internalInconsistencyException>.

[`NSPeriodic`](/documentation/AppKit/NSPeriodic) events don’t use this property.

## See Also

[`subtype`](/documentation/AppKit/NSEvent/subtype)

The event’s subtype.

[`+  otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:`](/documentation/AppKit/NSEvent/otherEvent(with:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:))

Creates and returns a new event object that describes a custom event.



---

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)