ppy / osu-framework

A game framework written with osu! in mind.
MIT License
1.67k stars 419 forks source link

Keep `PassThroughInputManager` in input queue even while parent input is disabled #6340

Closed frenzibyte closed 4 months ago

frenzibyte commented 4 months ago

Attached a vital failing test case that deems this to be an incorrect approach (coming from https://github.com/ppy/osu/issues/28931). When the PassThroughInputManager is hidden from the input queue, if there is a key pressed before parent input is enabled again, releasing the key after parent input is enabled does not trigger a KeyUpEvent on the PTIM, as demonstrated in the failing test case.

The purpose of hiding PTIM from the input queue in the first place is to prevent it from receiving a KeyDownEvent if parent input is enabled by another drawable that received the KeyDownEvent before the PTIM does (in osu! case, the PTIM is the gameplay input manager and the drawable is the osu! click-to-resume cursor; see OnPressed handling in the cursor).

To keep the osu!-side issue resolved (https://github.com/ppy/osu/issues/9658), this will be fixed differently by locally scheduling the resume operation one frame after the KeyDownEvent, so that the ruleset input manager does not see the event and no press is triggered on resume.