<!--
{
  "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

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

A mask that matches the pen tip.

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

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

[`NSEventButtonMaskPenUpperSide`](/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.

## Relationships

### Conforms To

[`ExpressibleByArrayLiteral`](/documentation/Swift/ExpressibleByArrayLiteral)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Sendable`](/documentation/Swift/Sendable)

[`SetAlgebra`](/documentation/Swift/SetAlgebra)

[`Equatable`](/documentation/Swift/Equatable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`OptionSet`](/documentation/Swift/OptionSet)

---

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)