Scroll to zoom without ctrl in `egui::Scene`
- Dominant language
- Rust
- Stars
- 30.6k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 72
Description
**Is your feature request related to a problem? Please describe.**
`egui::Scene` looks good for making an area pannable and zoomable, but by default, regular scrolling results in panning up and down. My use case would benefit more from dedicating the mouse wheel to zoom, kind of like a maps viewer interface.
**Describe the solution you'd like**
A modifier on `egui::Scene` like `.zoom_without_ctrl(true)` or `.mouse_wheel_zooms(true)`. When set, scrolling acts as if ctrl is always held. Maybe it could be flipped such that holding ctrl now pans up and down. Maybe that could be a separate setting. Or maybe there could be a mechanism where the user provides `|mods| if mods.command { Scroll } else { Zoom }`
**Describe alternatives you've considered**
I guess I could find a hacky workaround?
**Additional context**
I'm only considering mouse inputs here. I'm not sure how trackpad gestures work. I'd imagine two-finger panning would pan, and pinch gestures would zoom, and would not be affected by this setting.
Contributor guide
Research direction
The entry point is egui::Scene; locate its implementation and existing scroll/modifier handling first. Verify how mouse-wheel scrolling, ctrl, and trackpad gestures are currently distinguished, then define done as configurable wheel-to-zoom behavior that preserves the existing default and does not alter trackpad gestures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100