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

added Hash to MouseScrollUnit; #17538

Merged

Conversation

AustinHellerRepo
Copy link
Contributor

Objective

This allows for the usage of the MouseScrollUnit as a key to a HashSet and HashMap. I have a need for this, but this basic functionality is currently missing.

Solution

Add the derive Hash attribute to the MouseScrollUnit type.

Testing

  • Did you test these changes? If so, how?
    No, but I did perform a cargo build. My laptop is failing to run cargo test without crashing.
  • Are there any parts that need more testing?
    If someone could run a cargo test for completeness, that would be great but this is a trivial change.
  • How can other people (reviewers) test your changes? Is there anything specific they need to know?
    They simply need to ensure that the common Hash derive macro works as expected for the basic MouseScrollUnit type.
  • If relevant, what platforms did you test these changes on, and are there any important ones you can't test?
    Ubuntu 22.04

Copy link
Contributor

Welcome, new contributor!

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

@AustinHellerRepo
Copy link
Contributor Author

AustinHellerRepo commented Jan 25, 2025

I wanted to keep track of vertical and horizontal deltas per unit type in a HashMap, for when both types of scroll units are found at the same time. I wrote a more verbose work-around, but it would be nice to refactor it after this PR is merged in.

@Selene-Amanita Selene-Amanita added D-Trivial Nice and easy! A great choice to get started with Bevy A-Input Player input via keyboard, mouse, gamepad, and more C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 26, 2025
@BenjaminBrienen BenjaminBrienen added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 26, 2025
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Thanks for the justification :) That's the primary thing I look for when reviewing these PRs.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 26, 2025
@alice-i-cecile alice-i-cecile added this to the 0.15.2 milestone Jan 26, 2025
Merged via the queue into bevyengine:main with commit 1612d21 Jan 26, 2025
34 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 targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants