diff --git a/src/BizHawk.Client.Common/Api/Classes/JoypadApi.cs b/src/BizHawk.Client.Common/Api/Classes/JoypadApi.cs index 0cb771c5db..1a1f175e52 100644 --- a/src/BizHawk.Client.Common/Api/Classes/JoypadApi.cs +++ b/src/BizHawk.Client.Common/Api/Classes/JoypadApi.cs @@ -68,6 +68,18 @@ namespace BizHawk.Client.Common var buttonToSet = controller == null ? button : $"P{controller} {button}"; if (state == null) _inputManager.ButtonOverrideAdapter.UnSet(buttonToSet); else _inputManager.ButtonOverrideAdapter.SetButton(buttonToSet, state.Value); + + //"Overrides" is a gross line of code in that flushes overrides into the current controller. + //That's not really the way it was meant to work which was that it should pull all its values through the filters before ever using them. + //Of course the code that does that is in the main loop and the lua API wouldnt know how to do it. + //I regret the whole hotkey filter chain OOP soup approach. Anyway, the code that + + //in a crude, CRUDE, *CRUDE* approximation of what the main loop does, we need to pull the physical input again before it's freshly overridded + //but really, everything the main loop does needs to be done here again. + //I'm not doing that now. + _inputManager.ActiveController.LatchFromPhysical(_inputManager.ControllerInputCoalescer); + + //and here's where the overrides managed by this API are pushed in _inputManager.ActiveController.Overrides(_inputManager.ButtonOverrideAdapter); } catch