---
title: buttonNumber
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsevent/buttonnumber
---

# buttonNumber

The button number for a mouse event.

## Declaration

```swift
var buttonNumber: Int { get }
```

## Discussion

Discussion This property is intended for use with the NSOtherMouseDown, NSOtherMouseUp, and NSOtherMouseDragged events, but will return values for NSLeftMouse... and NSRightMouse... events also. If this event is not a mouse event, the property is set to 0.

## See Also

### Getting mouse event information

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