<h2 id="onehandedgesture-action-key-priority-enabledinambient-interactionsource-onshowindicator-ongesture">oneHandedGesture</h2>

<div class='sourceset sourceset-android'>Android</div>

```kotlin
@Composable
public fun Modifier.oneHandedGesture(
    action: GestureAction,
    key: String? = null,
    priority: GesturePriority = GesturePriority.Unspecified,
    enabledInAmbient: Boolean = false,
    interactionSource: MutableInteractionSource? = null,
    onShowIndicator: () -> Unit = {},
    onGesture: suspend () -> Unit,
): Modifier
```

Registers a gesture handler.

When a gesture is successfully triggered, the system automatically performs haptic feedback to
acknowledge the interaction; developers do not need to trigger haptics manually within
`onGesture`.

Example of adding one-handed gesture handler to a [androidx.wear.compose.material3.Button](/jetpack-compose/androidx.wear.compose/compose-material3/components/Button):

Example of adding one-handed gesture handler to a
[androidx.wear.compose.foundation.lazy.TransformingLazyColumn](/jetpack-compose/androidx.wear.compose/compose-foundation/composable-functions/TransformingLazyColumn):

Example of adding one-handed gesture handler to a
[androidx.wear.compose.foundation.pager.HorizontalPager](/jetpack-compose/androidx.wear.compose/compose-foundation/composable-functions/HorizontalPager):

Example of adding one-handed gesture handler to a
[androidx.wear.compose.foundation.pager.VerticalPager](/jetpack-compose/androidx.wear.compose/compose-foundation/composable-functions/VerticalPager):

#### Parameters

| | |
| --- | --- |
| action | The gesture action to handle. |
| key | A unique identifier for this gesture instance. This ID allows the system to track user interactions - for example, to mute gesture indicators that have been frequently shown or successfully performed, in accordance with user preferences. If the same key is reused across multiple gestures, they will share a common interaction history (such as frequency-based gesture indicator display logic). Note that this only affects the presentation of the UI; the underlying logic and handling remain independent for each instance. If [key](/jetpack-compose/androidx.compose.runtime/runtime/composable-functions/key) is null or empty, a unique key will be automatically generated based on the composition position of this gesture. |
| priority | The priority value; higher values take precedence if multiple handlers are registered for the same [action](/jetpack-compose/androidx.glance/glance/interfaces/Action). It is not recommended to register multiple gestures for the same action and priority (but if that is the case, all of them will be actioned). |
| enabledInAmbient | Whether the gesture should remain active in ambient mode. |
| interactionSource | [MutableInteractionSource](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/MutableInteractionSource) that will be used to dispatch [androidx.compose.foundation.interaction.Interaction](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Interaction)s for this gesture. This can be used to visualize the gesture state (e.g., showing a ripple or custom pressed state) when the one-handed gesture is being interacted with. |
| onShowIndicator | Callback invoked when the system determines a gesture indicator should be displayed for this component. This occurs when the component is visible and holds the highest priority for the current gesture. Only `GestureAction.Primary` gesture indicator callbacks will be called. |
| onGesture | The callback invoked when the gesture is triggered. |