<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSEvent/ButtonMask-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@E@NSEventButtonMask"
  },
  "title" : "NSEvent.ButtonMask"
}
-->

# NSEvent.ButtonMask

Constants you use to identify the activated tablet buttons in an event.

```
struct ButtonMask
```

## Topics

### Getting the Tablet Button Masks

[`penTip`](/documentation/AppKit/NSEvent/ButtonMask-swift.struct/penTip)

A mask that matches the pen tip.

[`penLowerSide`](/documentation/AppKit/NSEvent/ButtonMask-swift.struct/penLowerSide)

A mask that matches the button on the lower side of the device.

[`penUpperSide`](/documentation/AppKit/NSEvent/ButtonMask-swift.struct/penUpperSide)

A mask that matches the button on the upper side of the device.

### Initializers

[`init(rawValue:)`](/documentation/AppKit/NSEvent/ButtonMask-swift.struct/init(rawValue:))

### Deprecated

[`NSPenLowerSideMask`](/documentation/AppKit/NSPenLowerSideMask)

The button on the lower side of the device is activated.

[`NSPenTipMask`](/documentation/AppKit/NSPenTipMask)

The pen tip is activated.

[`NSPenUpperSideMask`](/documentation/AppKit/NSPenUpperSideMask)

The button on the upper side of the device is activated.



---

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)