# Mouse buttons

Handle the back and forward side buttons of a mouse as Compose pointer buttons.

The side buttons of a mouse reach Compose as `PointerButton.Back` and `PointerButton.Forward`, on
macOS, Windows and Linux. Use them for history navigation, as a browser or a file manager does:

```kotlin
Modifier.pointerInput(Unit) {
    awaitPointerEventScope {
        while (true) {
            val event = awaitPointerEvent()
            if (event.type != PointerEventType.Press) continue
            when (event.button) {
                PointerButton.Back -> navigator.back()
                PointerButton.Forward -> navigator.forward()
                else -> Unit
            }
        }
    }
}
```

Native popup windows and the Windows `NativeView` overlay do not receive the side buttons.

## What's next

- [Trackpad gestures](/docs/input/trackpad-gestures): scrolling, pinch and rotation.
- [Pointer icons](/docs/input/pointer-icons): cursors beyond the four Compose defines.
