Input update... always run directinput in background input mode, we take care of ignoring input when application isn't focused ourselves
This commit is contained in:
parent
a22cade8df
commit
2cbc50143f
|
@ -370,7 +370,7 @@
|
|||
public bool SmsAllowOverlock = false;
|
||||
public bool SmsForceStereoSeparation = false;
|
||||
|
||||
public string SmsReset = "Tab";
|
||||
public string SmsReset = "R";
|
||||
public string SmsPause = "J1 B8, Space";
|
||||
public SMSControllerTemplate[] SMSController = new SMSControllerTemplate[2];
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using SlimDX.DirectInput;
|
||||
|
||||
namespace BizHawk.MultiClient
|
||||
|
@ -19,6 +20,9 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public static bool IsPressed(string control)
|
||||
{
|
||||
if (Global.Config.AcceptBackgroundInput == false && Form.ActiveForm == null)
|
||||
return false; // application isn't active and background input is disabled
|
||||
|
||||
// Check joystick first, its easier
|
||||
if (control.StartsWith("J1 ")) return GetGamePad(0, control.Substring(3));
|
||||
if (control.StartsWith("J2 ")) return GetGamePad(1, control.Substring(3));
|
||||
|
|
|
@ -14,15 +14,12 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public static void Initialize()
|
||||
{
|
||||
if (dinput == null)
|
||||
if (dinput == null)
|
||||
dinput = new DirectInput();
|
||||
|
||||
if (keyboard == null || keyboard.Disposed)
|
||||
keyboard = new Keyboard(dinput);
|
||||
if (Global.Config.AcceptBackgroundInput)
|
||||
keyboard.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive);
|
||||
else
|
||||
keyboard.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Foreground | CooperativeLevel.Nonexclusive);
|
||||
keyboard.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive);
|
||||
}
|
||||
|
||||
public static void Update()
|
||||
|
|
|
@ -695,7 +695,6 @@ namespace BizHawk.MultiClient
|
|||
private void acceptBackgroundInputToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.AcceptBackgroundInput ^= true;
|
||||
MessageBox.Show("Background input settings will take effect the next time Bizhawk loads", "Background input property change", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private void displayStatusBarToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -37,16 +37,15 @@ namespace BizHawk.MultiClient
|
|||
|
||||
private void Timer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
Input.Update();
|
||||
TempBindingStr = Input.GetPressedKey();
|
||||
if (TempBindingStr != null)
|
||||
{
|
||||
int x = 0;
|
||||
x++;
|
||||
int y = x;
|
||||
// just for debugging. not really sure how to rebind from inside the timer?
|
||||
MessageBox.Show(TempBindingStr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UpdateLabel()
|
||||
{
|
||||
if (Bindings.Count == 0)
|
||||
|
|
Loading…
Reference in New Issue