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 helper functions for Event #1004

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

GuillaumeGomez
Copy link
Contributor

I had to write those helpers into my code so I think it's worth adding them upstream because I'm pretty sure I'm not the only one having some usage for them. :)

@Cobrand
Copy link
Member

Cobrand commented Jun 2, 2020

That's a pretty interesting function. I don't mind merging it, but just out of curiosity do you have a real world use-case for such a function?

I have written many SDL2-based applications and I don't remember needing such a function 🤔

EDIT: talking about is_same_kind_as()

@GuillaumeGomez
Copy link
Contributor Author

In case I'm in a menu, I want to be able to filter before calling a function. For now I have the function written in my code but having it upstream would be very convenient. :)

@GuillaumeGomez
Copy link
Contributor Author

Oh, is_same_kind_as is to be able to remove elements from my is_pressed vec. :)

I'll still need to have some more checks in case of buttons but that's already that less to check.

@Cobrand Cobrand merged commit 1b60519 into Rust-SDL2:master Jun 2, 2020
@Cobrand
Copy link
Member

Cobrand commented Jun 2, 2020

I think I get your use-case, thanks for the PR!

@GuillaumeGomez GuillaumeGomez deleted the event-helpers branch June 3, 2020 07:53
sypwex pushed a commit to sypwex/rust-sdl2 that referenced this pull request Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants