labwc/docs/scroll-cycle.md
iamcheyan 856da84f08 cursor: add scroll wheel support for window cycle
When cycle mode is active (Alt+Tab held), scrolling the mouse wheel
cycles through windows. Scroll down advances to the next window,
scroll up goes to the previous window.

This uses the same LAB_CYCLE_DIR_FORWARD/BACKWARD constants as the
keyboard handler, ensuring consistent navigation behavior.

No configuration needed - always active during cycle mode.
2026-06-13 08:25:22 +09:00

29 lines
1.2 KiB
Markdown

# Scroll Wheel Support for Window Cycle (Alt+Tab)
## Summary
Add mouse scroll wheel support to the Alt+Tab window switcher. When cycle mode is active (Alt+Tab held), scrolling the mouse wheel cycles through windows — scroll down for next, scroll up for previous.
## Usage
1. Press and hold **Alt+Tab** to enter cycle mode
2. **Scroll wheel down** → cycle to the next window
3. **Scroll wheel up** → cycle to the previous window
4. Release **Alt** to focus the selected window
No configuration needed — this behavior is always active during cycle mode.
## Technical Details
The patch intercepts `WL_POINTER_AXIS_VERTICAL_SCROLL` events in `handle_axis()` when `server.input_mode == LAB_INPUT_STATE_CYCLE`. It maps:
- Negative delta (scroll up) → `LAB_CYCLE_DIR_BACKWARD`
- Positive delta (scroll down) → `LAB_CYCLE_DIR_FORWARD`
These are the same direction constants used by the keyboard handler (`handle_cycle_view_key()` in `keyboard.c`), ensuring consistent behavior between keyboard and mouse navigation.
The event is consumed (not forwarded to clients or processed as mouse bindings) when cycle mode is active.
## Files Changed
- `src/input/cursor.c` — Added scroll wheel interception in `handle_axis()`