<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSControl/sendAction(on:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSControl(im)sendActionOn:"
  },
  "title" : "sendAction(on:)"
}
-->

# sendAction(on:)

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

```
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 `NSLeftMouseDownMask`,  `NSLeftMouseUpMask`, `NSLeftMouseDraggedMask`, and `NSPeriodicMask` bits.

## Return Value

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

## 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`](/documentation/AppKit/NSEvent) class reference.

The default implementation of this method simply invokes the [`sendAction(on:)`](/documentation/AppKit/NSCell/sendAction(on:)) method of its associated cell.

## See Also

[`-  sendActionOn:`](/documentation/AppKit/NSCell/sendAction(on:))

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



---

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)