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

# mouseDown(with:)

Responds to a mouse-down event.

```
func mouseDown(with event: NSEvent)
```

## Parameters

`event`

The mouse-down event.

## Discussion

A mouse-down event in a text cell initiates editing mode. A double click in any cell type except a text cell sends the double-click action of the receiver (if there is one) in addition to the single-click action.

Your code should never invoke this method, but you may override it to implement different mouse tracking than [`NSMatrix`](/documentation/AppKit/NSMatrix) does. The response of the receiver depends on its selection mode, as explained in the class description.

## See Also

[`-  sendAction`](/documentation/AppKit/NSMatrix/sendAction())

If the selected cell has both an action and a target, sends its action to its target.

[`-  sendDoubleAction`](/documentation/AppKit/NSMatrix/sendDoubleAction())

Sends the double-click action message to the target of the receiver.



---

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)