pass in mainform to Keyboard.cs instead of using global
This commit is contained in:
parent
9f86a2db6a
commit
eb438fd9cb
|
@ -127,7 +127,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
UpdateThread.Start();
|
UpdateThread.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize(Control parent)
|
||||||
{
|
{
|
||||||
if (OSTailoredCode.IsUnixHost)
|
if (OSTailoredCode.IsUnixHost)
|
||||||
{
|
{
|
||||||
|
@ -136,7 +136,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
KeyInput.Initialize();
|
KeyInput.Initialize(parent);
|
||||||
IPCKeyInput.Initialize();
|
IPCKeyInput.Initialize();
|
||||||
GamePad.Initialize();
|
GamePad.Initialize();
|
||||||
GamePad360.Initialize();
|
GamePad360.Initialize();
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Windows.Forms;
|
||||||
using SlimDX;
|
using SlimDX;
|
||||||
using SlimDX.DirectInput;
|
using SlimDX.DirectInput;
|
||||||
|
|
||||||
|
@ -11,7 +12,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private static DirectInput _directInput;
|
private static DirectInput _directInput;
|
||||||
private static Keyboard _keyboard;
|
private static Keyboard _keyboard;
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize(Control parent)
|
||||||
{
|
{
|
||||||
lock (SyncObj)
|
lock (SyncObj)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +21,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
_directInput = new DirectInput();
|
_directInput = new DirectInput();
|
||||||
|
|
||||||
_keyboard = new Keyboard(_directInput);
|
_keyboard = new Keyboard(_directInput);
|
||||||
_keyboard.SetCooperativeLevel(GlobalWin.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive);
|
_keyboard.SetCooperativeLevel(parent.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive);
|
||||||
_keyboard.Properties.BufferSize = 8;
|
_keyboard.Properties.BufferSize = 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,7 +325,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Sound?.StartSound();
|
Sound?.StartSound();
|
||||||
};
|
};
|
||||||
|
|
||||||
Input.Initialize();
|
Input.Initialize(this);
|
||||||
InitControls();
|
InitControls();
|
||||||
|
|
||||||
CoreFileProvider.SyncCoreCommInputSignals(comm);
|
CoreFileProvider.SyncCoreCommInputSignals(comm);
|
||||||
|
|
Loading…
Reference in New Issue