문제

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