Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/BizHawk.Bizware.Input/HostInputType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ public enum HostInputType
Keyboard = 2,
Pad = 4,
Ignored = 8,
IPC = 16,
}
}
1 change: 1 addition & 0 deletions src/BizHawk.Bizware.Input/IHostInputAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public interface IHostInputAdapter
void ProcessHostGamepads(Action<string?, bool, HostInputType> handleButton, Action<string?, int> handleAxis);

IEnumerable<KeyEvent> ProcessHostKeyboards();
IEnumerable<KeyEvent> ProcessHostIPC();

(int DeltaX, int DeltaY) ProcessHostMice();

Expand Down
7 changes: 5 additions & 2 deletions src/BizHawk.Bizware.Input/OSTailoredKeyInputAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#nullable enable

using System.Collections.Generic;
using System.Linq;

namespace BizHawk.Bizware.Input
{
Expand Down Expand Up @@ -41,7 +40,11 @@ public virtual IEnumerable<KeyEvent> ProcessHostKeyboards()
}

var ret = _keyMouseInput!.UpdateKeyInputs(_getHandleAlternateKeyboardLayouts());
return ret.Concat(IPCKeyInput.Update());
return ret;
}
public virtual IEnumerable<KeyEvent> ProcessHostIPC()
{
return IPCKeyInput.Update();
}

public virtual (int DeltaX, int DeltaY) ProcessHostMice()
Expand Down
7 changes: 6 additions & 1 deletion src/BizHawk.Client.EmuHawk/Input/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ private void UpdateThreadProc()
UpdateModifierKeysEffective();

var keyEvents = Adapter.ProcessHostKeyboards();
var ipcKeyEvents = Adapter.ProcessHostIPC();
var (mouseDeltaX, mouseDeltaY) = Adapter.ProcessHostMice();
Adapter.PreprocessHostGamepads();

Expand All @@ -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)
{
Expand Down Expand Up @@ -315,7 +320,7 @@ private void UpdateThreadProc()

private static bool ShouldSwallow(AllowInput allowInput, HostInputType inputFocus)
{
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()
Expand Down
Loading