Skip to content

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

Open
@alice-i-cecile

Description

@alice-i-cecile

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-InputPlayer input via keyboard, mouse, gamepad, and moreC-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions