Skip to content

GuiButtons bound with InputBinding.UIButton press their input actions - #40

Merged
rippelz merged 1 commit into
rippelz:mainfrom
Str8Anonymous:fix/uibutton-0.5
Nov 26, 2026
Merged

rippelz merged 1 commit into
rippelz:mainfrom
Str8Anonymous:fix/uibutton-0.5

Conversation

@Str8Anonymous

Copy link
Copy Markdown
Contributor

Summary

  • Play sends each GuiButton's MouseButton1Down / MouseButton1Up to the input action system. A Bool InputAction bound through InputBinding.UIButton is held from the button's MouseButton1Down to its MouseButton1Up, so Pressed / Released / StateChanged fire as they do for a key. Before this, UIButton was stored but nothing acted on it, so buttons that drive their game through input actions did nothing when clicked.
  • A key on the same binding doesn't press or release the action a second time, and disabled actions and contexts don't take the press.
  • docs/ENGINE-GAPS.md: a section for the closed gap.

Based on the Roblox docs (create.roblox.com/docs/input/input-action-system: "a GuiButton press/release through the binding's UIButton property"). Estimates, since the docs don't say: UIModifier is a second button held with UIButton, like PrimaryModifier for keys; context Priority and Sink apply to buttons as to keys; a press that never gets its MouseButton1Up (the button is hidden or leaves the game) ends when the left mouse button comes up, or when the button leaves the game.

Verification

  • New test runtime::tests::input_actions_follow_ui_button_presses.
  • cargo test --workspace --release --no-fail-fast: everything passes except renderer_builds_on_opengl, which fails on this machine's session with "Parent device is lost" (no OpenGL device available; the render crate isn't touched here).
  • Headless --play-only in a place whose menu tabs are ImageButtons bound with UIButton: clicking a tab now switches it, and the same place works when played on a laptop.

A Bool action is held while its binding's UIButton is held down, from the
button's MouseButton1Down to its MouseButton1Up (the docs: "a GuiButton
press/release through the binding's UIButton property"), so Pressed and
Released fire as they do for a key. A key on the same binding doesn't
press or release it a second time, and disabled actions and contexts
don't take the press. Play sends each GuiButton's MouseButton1Down / Up
to the input action system.

Estimates (the docs don't say): UIModifier is a second button that has
to be held with UIButton, like PrimaryModifier for keys; context Priority
and Sink apply to buttons as to keys; a press whose button is hidden or
leaves the game before it's let go (no MouseButton1Up) ends when the
left mouse button comes up, or as soon as the button leaves the game.
@rippelz
rippelz merged commit 9b68d7a into rippelz:main Nov 26, 2026
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

Successfully merging this pull request may close these issues.

2 participants