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

Add delta to CursorMoved event #11710

Merged
merged 9 commits into from
Feb 12, 2024
Merged

Add delta to CursorMoved event #11710

merged 9 commits into from
Feb 12, 2024

Conversation

lynn-lumen
Copy link
Contributor

Objective

Solution

  • Added delta: Option<Vec2> to bevy_window::CursorMoved. delta is an Option because the CursorMoved event does get fired when the cursor was outside the window area in the last frame. In that case there is no cursor position from the last frame to compare with the current cursor position.

Changelog

  • Added delta: Option<Vec2> to bevy_window::CursorMoved.

Migration Guide

  • You need to add delta to any manually created CursorMoved struct.

Copy link
Contributor

github-actions bot commented Feb 5, 2024

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@Kanabenki Kanabenki added A-Input Player input via keyboard, mouse, gamepad, and more C-Usability A simple quality-of-life change that makes Bevy easier to use labels Feb 5, 2024
crates/bevy_window/src/event.rs Outdated Show resolved Hide resolved
crates/bevy_window/src/event.rs Outdated Show resolved Hide resolved
crates/bevy_window/src/event.rs Show resolved Hide resolved
lynn-lumen and others added 3 commits February 5, 2024 18:55
Co-authored-by: Kanabenki <lucien.menassol@gmail.com>
Co-authored-by: Kanabenki <lucien.menassol@gmail.com>
Copy link
Contributor

@pablo-lua pablo-lua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple but great changes, I think we need a simple way to track this kind of thing, and this is indeed a good way.

crates/bevy_window/src/event.rs Show resolved Hide resolved
@james7132 james7132 added this pull request to the merge queue Feb 12, 2024
Merged via the queue into bevyengine:main with commit 2bc4825 Feb 12, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Usability A simple quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add delta to CursorMoved event
4 participants