From 3794a248749eefac1567dbf4facf20a9b7769185 Mon Sep 17 00:00:00 2001 From: Vincent Paquin Date: Sun, 2 Aug 2026 20:55:12 +0200 Subject: [PATCH 1/3] [CHANGED] IPC is now a HostInputType that doesn't get swallowed --- src/BizHawk.Bizware.Input/HostInputType.cs | 1 + src/BizHawk.Bizware.Input/IHostInputAdapter.cs | 1 + src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs | 6 +++++- src/BizHawk.Client.EmuHawk/Input/Input.cs | 8 ++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Bizware.Input/HostInputType.cs b/src/BizHawk.Bizware.Input/HostInputType.cs index aa5bc21f06b..b0a45b7dbe5 100644 --- a/src/BizHawk.Bizware.Input/HostInputType.cs +++ b/src/BizHawk.Bizware.Input/HostInputType.cs @@ -10,5 +10,6 @@ public enum HostInputType Keyboard = 2, Pad = 4, Ignored = 8, + IPC = 16, } } diff --git a/src/BizHawk.Bizware.Input/IHostInputAdapter.cs b/src/BizHawk.Bizware.Input/IHostInputAdapter.cs index 4c006c6de79..13e8de6a62a 100644 --- a/src/BizHawk.Bizware.Input/IHostInputAdapter.cs +++ b/src/BizHawk.Bizware.Input/IHostInputAdapter.cs @@ -23,6 +23,7 @@ public interface IHostInputAdapter void ProcessHostGamepads(Action handleButton, Action handleAxis); IEnumerable ProcessHostKeyboards(); + IEnumerable ProcessHostIPC(); (int DeltaX, int DeltaY) ProcessHostMice(); diff --git a/src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs b/src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs index 761351d3b9e..dfd52d3d06a 100644 --- a/src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs +++ b/src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs @@ -41,7 +41,11 @@ public virtual IEnumerable ProcessHostKeyboards() } var ret = _keyMouseInput!.UpdateKeyInputs(_getHandleAlternateKeyboardLayouts()); - return ret.Concat(IPCKeyInput.Update()); + return ret; + } + public virtual IEnumerable ProcessHostIPC() + { + return IPCKeyInput.Update(); } public virtual (int DeltaX, int DeltaY) ProcessHostMice() diff --git a/src/BizHawk.Client.EmuHawk/Input/Input.cs b/src/BizHawk.Client.EmuHawk/Input/Input.cs index 072449a18dc..8f6adc6dfb4 100644 --- a/src/BizHawk.Client.EmuHawk/Input/Input.cs +++ b/src/BizHawk.Client.EmuHawk/Input/Input.cs @@ -228,6 +228,7 @@ private void UpdateThreadProc() UpdateModifierKeysEffective(); var keyEvents = Adapter.ProcessHostKeyboards(); + var ipcKeyEvents = Adapter.ProcessHostIPC(); var (mouseDeltaX, mouseDeltaY) = Adapter.ProcessHostMice(); Adapter.PreprocessHostGamepads(); @@ -239,6 +240,10 @@ private void UpdateThreadProc() { HandleButton(DistinctKeyNameOverrides.GetName(ke.Key), ke.Pressed, HostInputType.Keyboard); } + foreach (var ke in ipcKeyEvents) + { + HandleButton(DistinctKeyNameOverrides.GetName(ke.Key), ke.Pressed, HostInputType.IPC); + } lock (_axisValues) { @@ -315,6 +320,9 @@ private void UpdateThreadProc() private static bool ShouldSwallow(AllowInput allowInput, HostInputType inputFocus) { + if (inputFocus == HostInputType.IPC) + return false; + return allowInput == AllowInput.None || (allowInput == AllowInput.OnlyController && inputFocus != HostInputType.Pad); } From fd368056c0a9ca93e7335dab0f86d53c8c2367a2 Mon Sep 17 00:00:00 2001 From: Vincent Paquin Date: Sun, 20 Sep 2026 09:21:27 +0200 Subject: [PATCH 2/3] Remove unnecessary using directive --- src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs b/src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs index dfd52d3d06a..92a6038dd73 100644 --- a/src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs +++ b/src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs @@ -1,7 +1,6 @@ #nullable enable using System.Collections.Generic; -using System.Linq; namespace BizHawk.Bizware.Input { From 57a5f1b774abaca34ebc2ec9a706bf78e98e63b7 Mon Sep 17 00:00:00 2001 From: Vincent Paquin Date: Sun, 20 Sep 2026 09:30:31 +0200 Subject: [PATCH 3/3] IPC HostInputType doesn't always gets a pass, it is now also based on allowInput type --- src/BizHawk.Client.EmuHawk/Input/Input.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/Input/Input.cs b/src/BizHawk.Client.EmuHawk/Input/Input.cs index 8f6adc6dfb4..caf8988178b 100644 --- a/src/BizHawk.Client.EmuHawk/Input/Input.cs +++ b/src/BizHawk.Client.EmuHawk/Input/Input.cs @@ -320,10 +320,7 @@ private void UpdateThreadProc() private static bool ShouldSwallow(AllowInput allowInput, HostInputType inputFocus) { - if (inputFocus == HostInputType.IPC) - return false; - - return allowInput == AllowInput.None || (allowInput == AllowInput.OnlyController && inputFocus != HostInputType.Pad); + return (allowInput is AllowInput.None && inputFocus is not HostInputType.IPC) || (allowInput == AllowInput.OnlyController && inputFocus != HostInputType.Pad); } public void StartListeningForAxisEvents()