Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use DeviceEvent::MouseMotion to get mouse delta when mouse go out of screen. #1611

Closed
enomado opened this issue May 9, 2022 · 0 comments · Fixed by #4063
Closed

use DeviceEvent::MouseMotion to get mouse delta when mouse go out of screen. #1611

enomado opened this issue May 9, 2022 · 0 comments · Fixed by #4063
Labels
bug Something is broken

Comments

@enomado
Copy link
Contributor

enomado commented May 9, 2022

This could enhance DragValue UX when mouse stuck in screen rect.

For example this http://idflood.github.io/draggable-number.js/ can increment number when mouse is out of screen, So I guesst browsers delta works the same way.

eframe/src/native/run.rs:206

@enomado enomado added the bug Something is broken label May 9, 2022
emilk pushed a commit that referenced this issue Feb 20, 2024
Raw mouse movement is unaccelerated and unclamped by screen boundaries,
and does not relate to any position on the screen.
It is useful in certain situations such as draggable values and 3D
cameras, where screen position does not matter.


https://github.com/emilk/egui/assets/1700581/1400e6a6-0573-41b9-99a1-a9cd305aa1a3

Added `Event::MouseMoved` for integrations to supply raw mouse movement.
Added `Response:drag_motion` to get the raw mouse movement, but will
fall back to delta in case the integration does not supply it.

Nothing should be breaking, but third-party integrations that can send
`Event::MouseMoved` should be updated to do so.

Based on #1614 but updated to the current version, and with better
fallback behaviour.

* Closes #1611
* Supersedes #1614
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant