---
title: "sendAction(on:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscell/sendaction(on:)"
---

# sendAction(on:)

Sets the conditions on which the receiver sends action messages to its target.

## Declaration

```swift
func sendAction(on mask: NSEvent.EventTypeMask) -> Int
```

## Parameters

- `mask`: A bit mask containing the conditions for sending the action. The only conditions that are actually checked are associated with the doc://com.apple.appkit/documentation/AppKit/NSLeftMouseDownMask, doc://com.apple.appkit/documentation/AppKit/NSLeftMouseUpMask, doc://com.apple.appkit/documentation/AppKit/NSLeftMouseDraggedMask, and doc://com.apple.appkit/documentation/AppKit/NSPeriodicMask bits.

## Return Value

Return Value A bit mask containing the previous settings. This bit mask uses the same values as specified in the mask parameter.

## Discussion

Discussion You use this method during mouse tracking when the mouse button changes state, the mouse moves, or if the cell is marked to send its action continuously while tracking. Because of this, the only bits checked in mask are NSLeftMouseDownMask,  NSLeftMouseUpMask, NSLeftMouseDraggedMask, and NSPeriodicMask, which are declared in the NSEvent class reference. You can use the isContinuous property to turn on the flag corresponding to NSPeriodicMask or NSLeftMouseDraggedMask, whichever is appropriate to the given subclass of NSCell.

## See Also

### Managing the Target and Action

- [action](appkit/nscell/action.md)
- [target](appkit/nscell/target.md)
- [isContinuous](appkit/nscell/iscontinuous.md)
