---
title: buttonMask
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nspressgesturerecognizer/buttonmask
---

# buttonMask

A bit mask of the buttons required to recognize this press.

## Declaration

```swift
var buttonMask: Int { get set }
```

## Discussion

Discussion Bit 0 represents the primary button, bit 1 is the secondary button, and so on. So to track clicks of the secondary button, assign the value 0x2 (which corresponds to a 1 in bit 1) to this property. The default value of this property is 0x1, which detects clicks in the primary mouse button. Changing the value of this property also sets the values of the delaysPrimaryMouseButtonEvents, delaysSecondaryMouseButtonEvents, and delaysOtherMouseButtonEvents properties to true for each of the buttons you specified.

## See Also

### Configuring the Gesture Recognizer

- [allowableMovement](appkit/nspressgesturerecognizer/allowablemovement.md)
- [minimumPressDuration](appkit/nspressgesturerecognizer/minimumpressduration.md)
- [numberOfTouchesRequired](appkit/nspressgesturerecognizer/numberoftouchesrequired.md)
