---
title: associatedEventsMask
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsevent/associatedeventsmask
---

# associatedEventsMask

The associated events mask of a mouse event.

## Declaration

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

## Discussion

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. 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 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

### Related Documentation

- [NSEvent.EventType.pressure](appkit/nsevent/eventtype/pressure.md)
- [pressure](appkit/nsevent/pressure.md)
- [NSEvent.EventTypeMask](appkit/nsevent/eventtypemask.md)

### Getting mouse event information

- [pressedMouseButtons](appkit/nsevent/pressedmousebuttons.md)
- [doubleClickInterval](appkit/nsevent/doubleclickinterval.md)
- [mouseLocation](appkit/nsevent/mouselocation.md)
- [buttonNumber](appkit/nsevent/buttonnumber.md)
- [clickCount](appkit/nsevent/clickcount.md)
