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

# buttonMask

A bit mask of the button (or buttons) required to recognize this click.

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

## 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`](/documentation/AppKit/NSGestureRecognizer/delaysPrimaryMouseButtonEvents), [`delaysSecondaryMouseButtonEvents`](/documentation/AppKit/NSGestureRecognizer/delaysSecondaryMouseButtonEvents), and [`delaysOtherMouseButtonEvents`](/documentation/AppKit/NSGestureRecognizer/delaysOtherMouseButtonEvents) properties to <doc://com.apple.documentation/documentation/Swift/true> for each of the buttons you specified.

---

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)