Mouse and Trackpad
A mouse or trackpad provides a way to activate interface elements and initiate actions using clicks and fluid, intuitive finger gestures to supplement keyboard input.
Clicks and Gestures
macOS supports a wide range of standard mouse and trackpad clicks and gestures that are highly customizable by the user. Individual clicks and gestures that aren’t primary ways of interacting with content can be enabled and disabled based on their applicability to the user’s workflow. The user can even choose specific regions of a mouse or trackpad for invoking secondary clicks, and select specific finger combinations and movements for certain gestures.
|Click or gesture||Expected behavior|
|Primary click||Select or activate an item, such as a file or button.|
|Secondary click||Reveal contextual menus.|
|Scrolling||Move content up, down, left, or right within a view.|
|Smart zoom||Zoom in or out on content, such as a web page or PDF.|
|Swipe between pages||Navigate forward or backward between individually displayed pages.|
|Swipe between full-screen apps||Navigate forward or backward between full-screen apps and spaces.|
|Mission Control (double-tap the mouse with two fingers or swipe up on the trackpad with three or four fingers)||Activate Mission Control.|
|Lookup and data detectors (force click with one finger or tap with three fingers)||Display a lookup window above selected content.|
|Tap to click||Perform the primary click action using a tap rather than a click.|
|Force click||Click then press firmly to display a Quick Look window or lookup window above selected content. Apply a variable amount of pressure to affect pressure-sensitive controls, such as variable speed media controls.|
|Zoom in or out (pinch with two fingers)||Zoom in or out.|
|Rotate (move two fingers in a circular motion)||Rotate content, such as an image.|
|Notification Center (swipe from the edge of the trackpad)||Display Notification Center.|
|App Exposé (swipe down with three or four fingers)||Display the current app’s windows in Exposé.|
|Launchpad (pinch with thumb and three fingers)||Display the user’s Launchpad.|
|Show Desktop (spread with thumb and three fingers)||Slide all windows out of the way so the user can see the desktop.|
Use standard controls and views. The standard controls and views automatically respond to most standard clicks and gestures. For example, a scroll view that implements a semantic layout and enables magnification automatically responds to the smart zoom gesture.
Respond to clicks and gestures based on meaning, not the user’s physical movements. The physical movement required to perform a gesture varies based on the user’s configuration. As a result, your app should monitor for and respond to specific meaningful events. For example, instead of watching for a two-finger swipe, your app might for a “Swipe between pages” event.
In general, respond to gestures in a way that’s consistent with other apps. People expect most gestures to work the same throughout the system, regardless of the current app. For example, the “Swipe between pages” gesture should behave the same way regardless of whether the user is browsing individual document pages, webpages, or images. On a system with a Force Touch trackpad, users expect apps to behave predictably and consistently when they force click a control to get more information or accelerate an action.
Avoid redefining systemwide, inter-app gestures. Even in a game that uses app-specific gestures in a custom way, people expect systemwide gestures be available for things like revealing Mission Control and switching between full-screen windows. Remember that users can customize the gestures for performing systemwide actions.
Handle gestures as responsively as possible. Gestures should enhance the user’s sense of direct manipulation and provide immediate, live feedback. To achieve this, minimize other operations while gestures are being performed.
Make sure gestures apply to the appropriate content. In general, gestures should apply to whatever content is the focus of the user’s attention. This may be a selected element or active view in a window. Start by identifying the most specific content the user is likely to be manipulating and make it the target of the gesture. If the content doesn’t respond to the gesture, then consider targeting higher content levels and containers
Define custom gestures cautiously. A custom gesture can be difficult to discover and remember. If a custom gesture seems gratuitous or awkward to perform, people are unlikely to use it. If you must define a custom gesture, make sure it’s easy to perform and not too similar to the gestures users already know.
Don’t rely on the availability of specific devices and gestures. You can’t be sure that all your users have a mouse or trackpad, or want to use it. In addition, users can disable and redefine gestures without your knowledge. Therefore, it’s best to offer multiple ways to initiate actions.
For developer guidance, see NSResponder.
The system offers a variety of standard pointer styles, which your app can use to communicate the interactive state of an interface element or the result of a drag operation.
|Arrow||Standard pointer for selecting and interacting with content and interface elements.||arrow()|
|Closed hand||Dragging to reposition the display of content within a view—for example, dragging a map around in Maps.||closedHand()|
|Contextual menu||A contextual menu is available for the content below the pointer. This pointer is generally shown only when the Control key is pressed.||contextualMenu()|
|Crosshair||Precise rectangular selection is possible, such as when viewing an image in Preview.||crosshair()|
|Disappearing item||A dragged item will disappear when dropped. If the item references an original item, the original is unaffected. For example, when dragging a mailbox out of the favorites bar in Mail, the original mailbox isn’t removed.||disappearingItem()|
|Drag copy||Duplicates a dragged—not moved—item when dropped into the destination. Appears when pressing the Option key during a drag operation.||dragCopy()|
|Drag link||During a drag and drop operation, creates an alias of the selected file when dropped. The alias points to the original file, which remains unmoved. Appears when pressing the Option and Command keys during a drag operation.||dragLink()|
|Horizontal I beam||Selection and insertion of text is possible in a horizontal layout, such as a TextEdit or Pages document.||I beam()|
|Open hand||Dragging to reposition content within a view is possible.||openHand()|
|Operation not allowed||A dragged item can’t be dropped in the current location.||operationNotAllowed()|
|Pointing hand||The content beneath the pointer is a URL link to a webpage, document, or other item.||pointingHand()|
|Resize down||Resize or move a window, view, or element downward.||resizeDown()|
|Resize left||Resize or move a window, view, or element to the left.||resizeLeft()|
|Resize left/right||Resize or move a window, view, or element to the left or right.||resizeLeftRight()|
|Resize right||Resize or move a window, view, or element to the right.||resizeRight()|
|Resize up||Resize or move a window, view, or element upward.||resizeUp()|
|Resize up/down||Resize or move a window, view, or element upward or downward.||resizeUpDown()|
|Vertical I beam||Selection and insertion of text is possible in a vertical layout.||iBeamCursorForVerticalLayout()|
Use system-provided pointers as intended. People are accustomed to the meaning of the standard pointer styles. If you change the meaning of one, users can’t predict the results of their actions.
Prefer system-provided pointers because they're familiar. If you must design a custom pointer, make sure it improves the usability of your app and isn’t confusing. For example, the user should intuitively know which part of the pointer to position over elements. If you customize the arrow pointer, create custom versions of the related arrow pointers too, such as copy and disappearing item.
When running on a device that’s equipped with a Force Touch trackpad, your app can provide haptic feedback to the user in response to a drag operation or force click in certain situations. There are three very specific haptic feedback patterns your app can adopt.
|Haptic feedback pattern||Description|
|Alignment||Indicates the alignment of a dragged item. For example, this pattern could be used in a drawing app when the user drags a shape into alignment with another shape. Other scenarios where this type of feedback could be used might include scaling an object to fit within specific dimensions, positioning an object at a preferred location, or reaching the beginning/minimum or end/maximum of something, such as a track view in an audio/video app.|
|Level Change||Indicates movement between discrete levels of pressure. For example, as the user presses a fast-forward button on a video player, playback could increase or decrease and haptic feedback could be provided as different levels of pressure are reached.|
|Generic||Intended for providing general feedback when the other patterns don’t apply.|
Use haptics judiciously. Overuse diminishes the feedback's significance and can cause confusion.
Provide haptic feedback in response to user-initiated actions. People easily correlate haptics with actions they initiate. Haptics that occur at other times can seem arbitrary, which can lead to confusion and a disconnected user experience.
Don’t redefine feedback types. To ensure a consistent experience, use feedback types as intended. Alignment and level Change feedback patterns are for very specific use cases and should be used consistently throughout the system. If the use cases for these patterns don’t apply to your app, use the generic pattern.
Fine-tune your visual experience for haptics. Provide visual and haptic feedback together to create a deeper connection between actions and results. Make sure animations are sharp and precise, to visually match what the user feels.
Don’t rely on a single mode of communication. Not all devices support the full range of haptic feedback, and people can disable the feature entirely in Settings if they choose. In addition, haptic feedback occurs only when the device is active and your app is frontmost. Supplement haptics with visual and audible cues to ensure that important information isn’t missed.
Synchronize haptics with accompanying sound. Haptics don’t automatically synchronize with sounds. If you want an audible cue, you synchronize the sound with the haptic.
For developer guidance, see NSHapticFeedbackPerformer.