rust-windowing / rust-windowing/winit
Don't check for keyboard modifiers state on a flood of mouse events
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
Description
(this is from a discussion from https://github.com/rust-windowing/winit/pull/4235)
Currently Winit performs checks for whether modifiers are changed on every single mouse event, which is rather inefficient as such input devices can generate a lot of events, so you'd be wasting a lot of API calls for key state.
And there are already some guards against missed keyboard/modifier changing events (e.g., if when the app regains focus, Winit checks modifier state), so the question is, could these mouse input checks be replaced by similar guards for the remaining cases where modifier change events are missed?
Unofrunately, I don't know what those are, so just leaving it as an open issue
Not sure about how other platforms do it, so marking this as Windows only
Relevant platforms
Windows
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing Winit's Windows handling of mouse events and the existing modifier-state guard used when the application regains focus. Identify the remaining cases where modifier changes can be missed, then verify that removing per-mouse-event checks preserves correct modifier state across those cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100