質問

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.

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top