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
19 changes: 18 additions & 1 deletion Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ public static extern void SetDinputDeviceGUID(uint instanceHandle,

[DllImport("ProtoInputLoader32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetAdjustWindowRectSettings(uint instanceHandle, int posx, int posy, int width, int height);

[DllImport("ProtoInputLoader32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern void DisableGuiWindow(uint instanceHandle, bool enable);
}

private static class ProtoInput64
Expand Down Expand Up @@ -427,6 +430,9 @@ public static extern void SetDinputDeviceGUID(uint instanceHandle,

[DllImport("ProtoInputLoader64.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern void SetAdjustWindowRectSettings(uint instanceHandle, int posx, int posy, int width, int height);

[DllImport("ProtoInputLoader64.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern void DisableGuiWindow(uint instanceHandle, bool enable);
}

public uint LockInput(bool lockInput)
Expand Down Expand Up @@ -1128,6 +1134,17 @@ public void SetAdjustWindowRectSettings(uint instanceHandle, int posx, int posy,
ProtoInput64.SetAdjustWindowRectSettings(instanceHandle, posx, posy, width, height);
}
}


public void DisableGuiWindow(uint instanceHandle, bool enable)
{
if (IntPtr.Size == 4)
{
ProtoInput32.DisableGuiWindow(instanceHandle, enable);
}
else
{
ProtoInput64.DisableGuiWindow(instanceHandle, enable);
}
}
}
}
8 changes: 5 additions & 3 deletions Master/NucleusGaming/Coop/ProtoInput/ProtoInputLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ private static void SetupInstance(uint instanceHandle, int instanceIndex, Generi

ProtoInput.protoInput.SetupState(instanceHandle, instanceIndex);

ProtoInput.protoInput.DisableGuiWindow(instanceHandle, gen.ProtoInput.DisableGuiWindow);

if (gen.ProtoInput.RegisterRawInputHook)
{
ProtoInput.protoInput.InstallHook(instanceHandle, ProtoInput.ProtoHookIDs.RegisterRawInputHookID);
Expand Down Expand Up @@ -265,7 +267,7 @@ private static void SetupInstance(uint instanceHandle, int instanceIndex, Generi
ProtoInput.protoInput.SetSetWindowPosDontResize(instanceHandle, gen.ProtoInput.SetWindowPosHook == SetWindowPosHook.DontResize);
ProtoInput.protoInput.SetSetWindowPosDontReposition(instanceHandle, gen.ProtoInput.SetWindowPosHook == SetWindowPosHook.DontReposition);
ProtoInput.protoInput.SetSetWindowPosSettings(instanceHandle, player.MonitorBounds.X, player.MonitorBounds.Y, player.MonitorBounds.Width, player.MonitorBounds.Height);

if (gen.ProtoInput.SetWindowPosHook == SetWindowPosHook.DontResize || gen.ProtoInput.SetWindowPosHook == SetWindowPosHook.DontReposition || gen.ProtoInput.SetWindowPosHook != 0)
{
ProtoInput.protoInput.InstallHook(instanceHandle, ProtoInput.ProtoHookIDs.SetWindowPosHookID);
Expand Down Expand Up @@ -360,11 +362,11 @@ private static void SetupInstance(uint instanceHandle, int instanceIndex, Generi
gen.ProtoInput.FocusLoop_WM_MOUSEACTIVATE);
}

ProtoInput.protoInput.SetDrawFakeCursorFix(instanceHandle, gen.ProtoInput.DrawFakeCursor == DrawFakeCursor.Fix);
ProtoInput.protoInput.SetDrawFakeCursor(instanceHandle, gen.ProtoInput.DrawFakeCursor == DrawFakeCursor.Fix || gen.ProtoInput.DrawFakeCursor != 0);
ProtoInput.protoInput.SetDefaultTopLeftMouseBounds(instanceHandle, gen.ProtoInput.PutMouseInsideWindow == PutMouseInsideWindow.IgnoreTopLeft);
ProtoInput.protoInput.SetDefaultBottomRightMouseBounds(instanceHandle, gen.ProtoInput.PutMouseInsideWindow == PutMouseInsideWindow.IgnoreBottomRight);
ProtoInput.protoInput.SetPutMouseInsideWindow(instanceHandle, gen.ProtoInput.PutMouseInsideWindow == PutMouseInsideWindow.IgnoreTopLeft || gen.ProtoInput.PutMouseInsideWindow == PutMouseInsideWindow.IgnoreBottomRight || gen.ProtoInput.PutMouseInsideWindow != 0);
ProtoInput.protoInput.SetDrawFakeCursorFix(instanceHandle, gen.ProtoInput.DrawFakeCursor == DrawFakeCursor.Fix);
ProtoInput.protoInput.SetDrawFakeCursor(instanceHandle, gen.ProtoInput.DrawFakeCursor == DrawFakeCursor.Fix || gen.ProtoInput.DrawFakeCursor != 0);
ProtoInput.protoInput.AllowFakeCursorOutOfBounds(instanceHandle, gen.ProtoInput.AllowFakeCursorOutOfBounds, gen.ProtoInput.ExtendFakeCursorBounds);
ProtoInput.protoInput.SetToggleFakeCursorVisibilityShortcut(instanceHandle,
gen.ProtoInput.EnableToggleFakeCursorVisibilityShortcut,
Expand Down
2 changes: 2 additions & 0 deletions Master/NucleusGaming/Coop/ProtoInput/ProtoInputOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public class ProtoInputOptions
public bool DinputHookAlsoHooksGetDeviceState;

public bool FreezeExternalInputWhenInputNotLocked;

public bool DisableGuiWindow;

public Action OnInputLocked;
public Action OnInputUnlocked;
Expand Down