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

# associatedEventsMask

The associated events mask of a mouse event.

```
var associatedEventsMask: NSEvent.EventTypeMask { get }
```

## Discussion

This property pertains to mouse events. It’s used to determine whether the input device issuing the event can simultaneously issue events of type [`NSEvent.EventType.pressure`](/documentation/AppKit/NSEvent/EventType/pressure). This can be useful if you need to determine whether to initiate or begin initiating a pressure-related action when a mouse event occurs.

For example, suppose you are writing a painting app that uses pressure to determine the size of brush stroke to apply. You can use `associatedEventsMask` to determine whether a mouse-click event is occurring simultaneously with a pressure event. If not, the user may not have pressure-sensitive hardware and you can apply a default size to the brush stroke.

Listing 1. Example usage of the associatedEventMask property

```objc
if (event.associatedEventMask & NSEventMaskPressure) {
   self.pressure = 0; // Prepare for pressure events
} else if (event.subtype == NSTabletPointEventSubtype) {
   self.pressure = event.pressure; // For tablets, the pressure value is embedded in the mouse event
} else {
   self.pressure = 1; // The input device does not support pressure sensitivity, so default to full pressure
}
```

## See Also

[`NSEvent.EventType.pressure`](/documentation/AppKit/NSEvent/EventType/pressure)

An event that reports a change in pressure on a pressure-sensitive device.

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

A normalized value that indicates the degree of pressure applied to an appropriate input device.

[`NSEvent.EventTypeMask`](/documentation/AppKit/NSEvent/EventTypeMask)

Constants that you use to filter out specific event types from the stream of incoming events.



---

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)