Skip to content
New issue

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

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

Already on GitHub? # to your account

Add a way to detect what input modality (e.g. gamepad, KBM) is used #17666

Open
alice-i-cecile opened this issue Feb 3, 2025 · 0 comments
Open
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Feature A new feature, making something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!

Comments

@alice-i-cecile
Copy link
Member

What problem does this solve or what need does it fill?

Games commonly display different prompts based on the input mode the player is using.

This information is also useful for analytics (to inform development priorities).

What solution would you like?

Define an InputModality enum, stored in a resource.

In a PreUpdate system (as part of InputPlugin) each frame, listen to touch, gamepad, KBM etc events, and set the modality based on what is being used.

Maybe make this system toggleable?

What alternative(s) have you considered?

Reimplement this in every game that needs this, or reimplement this in a downstream crate.

Additional context

Previously discussed in projectharmonia/bevy_enhanced_input#22, but fundamentally this is bevy_input's problem.

@alice-i-cecile alice-i-cecile added A-Input Player input via keyboard, mouse, gamepad, and more C-Feature A new feature, making something new possible S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! D-Straightforward Simple bug fixes and API improvements, docs, test and examples D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes and removed D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Feb 3, 2025
@alice-i-cecile alice-i-cecile changed the title Add a way to detect what input modality is used Add a way to detect what input modality (e.g. gamepad, KBM) is used Feb 3, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Feature A new feature, making something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

No branches or pull requests

1 participant