Pergunta

Is there a way to detect a click and hold within a NSView? I want to trigger an event after holding the mouse button down for 0.5 sec - similar to a longPressGesture in iOS.

Foi útil?

Solução

I don't know of a specific selector for this, which is what it sounds like you're asking for, but you could, quite easily, handle this yourself.

Start a timer when the mouse down event occurs and when the amount of time has passed, react to it if the mouse up event did not occur before the specified elapsed time.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top