bevyengine / bevyengine/bevy

"Pressed" detection bugged after unfocusing in game in WASM

Open
#12,472 0 comments 0 reactions 0 assignees View on GitHub
A-Input C-Bug O-Web
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version
0.13

## \[Optional\] Relevant system information
- Windows 10
- Firefox
- Chrome

## What you did
I held down a button then unfocused the window.

## What went wrong
The button remained held down according to ButtonInput "pressed" even when I released it. Refocusing the window does not fix this, but refocusing then pressing and releasing does.

## Additional information
Tested in both Firefox and Chrome with similar behaviors.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in a WASM build in Firefox and Chrome, using the ButtonInput "pressed" state and the focus-loss sequence described. Trace how input state is handled when the game window loses and regains focus; done when releasing the button after refocusing clears the pressed state without requiring another press.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.