---
title: "handGestureShortcut(_:isEnabled:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/handgestureshortcut(_:isenabled:)"
---

# handGestureShortcut(_:isEnabled:)

Assigns a hand gesture shortcut to the modified control.

## Declaration

```swift
nonisolated func handGestureShortcut(_ shortcut: HandGestureShortcut, isEnabled: Bool = true) -> some View

```

## Parameters

- `shortcut`: The shortcut to associate with this control.
- `isEnabled`: A Boolean value that indicates whether the shortcut is is enabled for this control.

## Discussion

Discussion Performing the control’s shortcut while the control is anywhere in the frontmost scene is equivalent to direct interaction with the control to perform its primary action. The following example lets users of a watchOS music app toggle playback by double-tapping their thumb and index finger together: struct PlaybackControls: View {     let model: TrackModel

var body: some View {         HStack {             Button("Skip Back") {                 model.skipBack()             }

Button("Play/Pause") {                 model.playPause()             }             .handGestureShortcut(.primaryAction)

Button("Skip Forward") {                 model.skipForward()             }         }     } } The target of a hand gesture shortcut is resolved in a leading-to-trailing traversal of the active scene.

## See Also

### Defining custom gestures

- [highPriorityGesture(_:including:)](swiftui/view/highprioritygesture(_:including:).md)
- [highPriorityGesture(_:isEnabled:)](swiftui/view/highprioritygesture(_:isenabled:).md)
- [highPriorityGesture(_:name:isEnabled:)](swiftui/view/highprioritygesture(_:name:isenabled:).md)
- [defersSystemGestures(on:)](swiftui/view/deferssystemgestures(on:).md)
- [Gesture](swiftui/gesture.md)
- [AnyGesture](swiftui/anygesture.md)
- [HandActivationBehavior](swiftui/handactivationbehavior.md)
- [HandGestureShortcut](swiftui/handgestureshortcut.md)
