Leafwing-Studios / leafwing-input-manager

A straightforward stateful input manager for the Bevy game engine.
Apache License 2.0
616 stars 92 forks source link

LWIM does not respect `FocusPolicy` #547

Closed msvbg closed 3 weeks ago

msvbg commented 3 weeks ago

Version

0.13

What you did

Create an ImageBundle, which comes with a FocusPolicy, and set FocusPolicy::Block.

What you expected to happen

The input should be blocked from interacting with the game world

What actually happened

It doesn't block input events unless I also add Interaction::None to the bundle.

Additional information

Related to: https://github.com/bevyengine/bevy/issues/13827

The proper solution is perhaps to replace this code https://github.com/Leafwing-Studios/leafwing-input-manager/blob/6ac10268849dbd87ebbfd431479ba0fd15aa66ce/src/systems.rs#L123-L131 with something that traverses the UI nodes and looks for FocusPolicy, instead of just detecting Interaction, which may not always be present.

alice-i-cecile commented 3 weeks ago

This code has since been removed for the upcoming release, so I'm going to mark this as "fixed" ;)

msvbg commented 3 weeks ago

It looks to me like it's still there on 0.14-rc.2! https://github.com/Leafwing-Studios/leafwing-input-manager/blob/v0.14-rc/src/systems.rs#L93-L101

alice-i-cecile commented 3 weeks ago

Yep, that branch is for a strict Bevy upgrade bump :) I'll be cutting 0.15 right after with all the breaking changes (like #540) that have accumulated on main.