diff --git a/src/BizHawk.Client.EmuHawk/Input/Input.cs b/src/BizHawk.Client.EmuHawk/Input/Input.cs index e90c295563..5aad4dafc8 100644 --- a/src/BizHawk.Client.EmuHawk/Input/Input.cs +++ b/src/BizHawk.Client.EmuHawk/Input/Input.cs @@ -133,6 +133,9 @@ namespace BizHawk.Client.EmuHawk private void HandleAxis(string axis, int newValue) { + if (ShouldSwallow(MainFormInputAllowedCallback(false), ClientInputFocus.Pad)) + return; + if (_trackDeltas) _axisDeltas[axis] += Math.Abs(newValue - _axisValues[axis]); _axisValues[axis] = newValue; } @@ -250,9 +253,9 @@ namespace BizHawk.Client.EmuHawk foreach (var ie in _newEvents) { //events are swallowed in some cases: - if ((ie.LogicalButton.Modifiers & LogicalButton.MASK_ALT) is not 0U && ShouldSwallow(MainFormInputAllowedCallback(true), ie)) + if ((ie.LogicalButton.Modifiers & LogicalButton.MASK_ALT) is not 0U && ShouldSwallow(MainFormInputAllowedCallback(true), ie.Source)) continue; - if (ie.EventType == InputEventType.Press && ShouldSwallow(allowInput, ie)) + if (ie.EventType == InputEventType.Press && ShouldSwallow(allowInput, ie.Source)) continue; EnqueueEvent(ie); @@ -267,9 +270,9 @@ namespace BizHawk.Client.EmuHawk } } - private static bool ShouldSwallow(AllowInput allowInput, InputEvent inputEvent) + private static bool ShouldSwallow(AllowInput allowInput, ClientInputFocus inputFocus) { - return allowInput == AllowInput.None || (allowInput == AllowInput.OnlyController && inputEvent.Source != ClientInputFocus.Pad); + return allowInput == AllowInput.None || (allowInput == AllowInput.OnlyController && inputFocus != ClientInputFocus.Pad); } public void StartListeningForAxisEvents() @@ -326,7 +329,7 @@ namespace BizHawk.Client.EmuHawk { InputEvent ie = DequeueEvent(); - if (ShouldSwallow(allowInput, ie)) continue; + if (ShouldSwallow(allowInput, ie.Source)) continue; if (ie.EventType == InputEventType.Press) {