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

Feature Request: pads.any.just_pressed(..) (and similar) #7

Open
fwolfst opened this issue Feb 19, 2025 · 0 comments
Open

Feature Request: pads.any.just_pressed(..) (and similar) #7

fwolfst opened this issue Feb 19, 2025 · 0 comments

Comments

@fwolfst
Copy link

fwolfst commented Feb 19, 2025

Assume a single player scenario. The application should support both keyboard/mouse and controller support.

To simplify control flow even when two controllers would be connected, I could imagine following API

// macroquad pseudo code
if is_key_down(KeyCode::A) || pads.any.is_currently_pressed(gamepads::Button::ActionLeft) {
  world.player_orientation -= 0.2 * delta;
}

There are some basic assumptions to make (e.g. only check axis of first gamepad) and document.
I am too new to rust to know if consumers of the gampad crate can achieve something like this easily themselves (with funky closures?).

🙏 for the nicely documented crate.

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

No branches or pull requests

1 participant