Class

NSPressGestureRecognizer

A discrete gesture recognizer that tracks whether the user held down a mouse button for a minimum amount of time before releasing it.

Declaration

@interface NSPressGestureRecognizer : NSGestureRecognizer

Overview

Use a press gesture recognizer to configure which button must be held and the amount of time for which it must be held. You can also specify how far the mouse is allowed to move and still be considered a valid gesture.

Upon creation, the gesture recognizer is configured to recognize press gestures involving only the primary button. It also delays sending primary button events to the view by setting the delaysPrimaryMouseButtonEvents property to YES. To change the set of buttons to track, modify the buttonMask property.

Topics

Configuring the Gesture Recognizer

buttonMask

A bit mask of the button (or buttons) required to recognize this press.

minimumPressDuration

The minimum time (in seconds) that the mouse button must be held down in the view for the gesture to be recognized.

allowableMovement

The maximum movement of the mouse in the view before the gesture fails.

Instance Properties

numberOfTouchesRequired

The number of touches required in an NSTouchBar object for the gesture recognizer to match.

Relationships

Inherits From

Conforms To

See Also

Standard Gestures

NSClickGestureRecognizer

A discrete gesture recognizer that tracks a specified number of mouse clicks.

NSPanGestureRecognizer

A continuous gesture recognizer for panning (dragging) gestures.

NSRotationGestureRecognizer

A continuous gesture recognizer that tracks two trackpad touches moving opposite each other in a circular motion.

NSMagnificationGestureRecognizer

A continuous gesture recognizer that tracks a pinch gesture used to magnify content.