mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
The on-screen controls have had tap-to-hold since they existed; physical buttons always followed the button exactly. A game that wants one held while another control is worked -- MGS2 holding R1 to aim -- is then unplayable for anyone who cannot hold two controls at once, which is what the request was about. Modelled as a transform on the event stream rather than a branch beside turbo: a tap becomes a synthetic KeyDown, the next tap a synthetic KeyUp, and everything between is swallowed. Turbo composes with it for free -- flag a button both and a tap toggles autofire on and off. Keyed on the physical code for "is this a fresh press", because ACTION_DOWN auto-repeats while a key is held and each repeat would otherwise toggle, and on the PS2 target for "is it latched", so two physical buttons bound to the same button cannot desync. The state lives in the companion because the boot path that clears it runs there -- a latch must not outlive the game it was set in -- while the dispatch that sets it is an instance method. Changing the setting releases whatever is held: turning it off for a button that is latched down would otherwise strand it pressed, with no second tap left to release it. Stored per action per player like turbo, and off by default. Feature requested by bobo123g (#612)