Skip to content

Input Rework #17347

Open
Open
@Kees-van-Beilen

Description

@Kees-van-Beilen

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

Bevy is supposed to be this modular game engine, but its current input solution is everything but that, The current input systems on itself is modular but not in the way most people would want it. I've realised during the development of my commercial game and UI is the worst offender writing a cross platform UI is a massive pain: in mobile games its normal to fire a button click on release (Something not quite builtin to bevy), and there currently isn't a good builtin way to do GamePads in UI that doesn't require a lot of repetitive code

What solution would you like?

A new layer on top of the current input system (and a small change to the Interaction enum). These are just some of my ideas I'm very open to discussion as I want the best solution. Also I would like to know what would be more appreciated: a proof of concept pr or proof of concept library.

Resources:

  • Focused(Entity): The (ui) entity that is currently in focus
    Components:
  • GamePadEnabledButton(...) Let a button of a gamepad interact with the buttons Interaction as long as this entity is the focused entity or the child of the focused entity
  • FocusLayout
    FocusLayout{
        next:Option<Entity>,
        previous:Option<Entity>,
        left:Option<Entity>,
        right:Option<Entity>,
        up:Option<Entity>,
        down:Option<Entity>,
    }

A component that instructs where focus will go to next (upon pressing a directional key)

In addition the Interaction enum will need cases for Outline/Focus for when an entity is in focus and some sort Released/Confirmed for when the button is released.

Also I don't think it would be crazy to add a full input manager above the input system, but that might be out of scope

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-InputPlayer input via keyboard, mouse, gamepad, and moreC-FeatureA new feature, making something new possibleD-ComplexQuite challenging from either a design or technical perspective. Ask for help!S-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions