Skip to content

Add support for detecting release of a button #5769

@Weibye

Description

@Weibye

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

Currently we detect when a button is being hovered, or clicked, but not released.

pub enum Interaction {
    /// The node has been clicked
    Clicked,
    /// The node has been hovered over
    Hovered,
    /// Nothing has happened
    #[default]
    None,
}

In this case Clicked is true when the user presses down on the button.

What solution would you like?

Add a Released variant to the Interaction enum, then add whatever logic necessary to correctly detect it.

What alternative(s) have you considered?

  • Not supporting it is not really an option. Most applications (and games) only trigger the button's action on release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-InputPlayer input via keyboard, mouse, gamepad, and moreA-UIGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions