pointerInput & detectTapGestures
Detect tap, double-tap, and long press.
The Gateway to Touch
To handle raw touch in Compose you reach for the pointerInput modifier. It gives any element a place to read finger events directly. 👆
Add It to Any Composable
Attach pointerInput in a Modifier chain. Inside its lambda you get a gesture scope where you can listen for taps, drags, and more.
Box(Modifier.pointerInput(Unit) {
// gesture detectors go here
})All lessons in this course
- pointerInput & detectTapGestures
- Drag, Swipe & Fling
- Transform: Pan, Zoom & Rotate
- Nested Scroll Connections