NSResponder seems to have no mouse double click event. Is there an easy way to catch a double click?
NSResponder seems to have no mouse double click event. Is there an easy way to catch a double click?
The mouseDown: and mouseUp: methods take an NSEvent object as an argument with information about the clicks, including the clickCount.
An alternative to the mouseDown: + NSTimer method that I prefer is NSClickGestureRecognizer.
let doubleClickGestureRecognizer = NSClickGestureRecognizer(target: self, action: #selector(self.myCustomMethod))
doubleClickGestureRecognizer.numberOfClicksRequired = 2
self.myView.addGestureRecognizer(doubleClickGestureRecognizer)