Ability to set Bizhawk to Accept Background Input. TODO: currently only takes affect on bizhawk restart, find a way around this.
This commit is contained in:
parent
839d1e3cca
commit
fe563656b9
|
@ -96,6 +96,7 @@
|
|||
public int MainWndx = -1; //Negative numbers will be ignored
|
||||
public int MainWndy = -1;
|
||||
public bool RunInBackground = true;
|
||||
public bool AcceptBackgroundInput = false;
|
||||
|
||||
// Run-Control settings
|
||||
public int FrameProgressDelayMs = 500; //how long until a frame advance hold turns into a frame progress?
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace BizHawk.MultiClient
|
|||
private static Keyboard keyboard;
|
||||
private static KeyboardState state = new KeyboardState();
|
||||
private static List<Key> unpressedKeys = new List<Key>();
|
||||
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
if (dinput == null)
|
||||
|
@ -18,8 +18,10 @@ namespace BizHawk.MultiClient
|
|||
|
||||
if (keyboard == null || keyboard.Disposed)
|
||||
keyboard = new Keyboard(dinput);
|
||||
|
||||
keyboard.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Foreground | CooperativeLevel.Nonexclusive);
|
||||
if (Global.Config.AcceptBackgroundInput)
|
||||
keyboard.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive);
|
||||
else
|
||||
keyboard.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Foreground | CooperativeLevel.Nonexclusive);
|
||||
}
|
||||
|
||||
public static void Update()
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
this.playFromBeginningToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.replayInputLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.bindSavestatesToMoviesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.screenshotToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.screenshotF12ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.screenshotAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -189,7 +190,7 @@
|
|||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.EmuStatus = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.bindSavestatesToMoviesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.acceptBackgroundInputToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
|
@ -730,6 +731,13 @@
|
|||
this.replayInputLogToolStripMenuItem.Text = "Replay Input Log";
|
||||
this.replayInputLogToolStripMenuItem.Click += new System.EventHandler(this.replayInputLogToolStripMenuItem_Click);
|
||||
//
|
||||
// bindSavestatesToMoviesToolStripMenuItem
|
||||
//
|
||||
this.bindSavestatesToMoviesToolStripMenuItem.Name = "bindSavestatesToMoviesToolStripMenuItem";
|
||||
this.bindSavestatesToMoviesToolStripMenuItem.Size = new System.Drawing.Size(211, 22);
|
||||
this.bindSavestatesToMoviesToolStripMenuItem.Text = "Bind Savestates to Movies";
|
||||
this.bindSavestatesToMoviesToolStripMenuItem.Click += new System.EventHandler(this.bindSavestatesToMoviesToolStripMenuItem_Click);
|
||||
//
|
||||
// screenshotToolStripMenuItem
|
||||
//
|
||||
this.screenshotToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
|
@ -1026,7 +1034,8 @@
|
|||
this.startPausedToolStripMenuItem,
|
||||
this.enableRewindToolStripMenuItem,
|
||||
this.forceGDIPPresentationToolStripMenuItem,
|
||||
this.runInBackgroundToolStripMenuItem});
|
||||
this.runInBackgroundToolStripMenuItem,
|
||||
this.acceptBackgroundInputToolStripMenuItem});
|
||||
this.gUIToolStripMenuItem.Name = "gUIToolStripMenuItem";
|
||||
this.gUIToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
|
||||
this.gUIToolStripMenuItem.Text = "GUI";
|
||||
|
@ -1454,12 +1463,12 @@
|
|||
this.EmuStatus.Size = new System.Drawing.Size(143, 17);
|
||||
this.EmuStatus.Text = "Currently emulating: ur mom";
|
||||
//
|
||||
// bindSavestatesToMoviesToolStripMenuItem
|
||||
// acceptBackgroundInputToolStripMenuItem
|
||||
//
|
||||
this.bindSavestatesToMoviesToolStripMenuItem.Name = "bindSavestatesToMoviesToolStripMenuItem";
|
||||
this.bindSavestatesToMoviesToolStripMenuItem.Size = new System.Drawing.Size(211, 22);
|
||||
this.bindSavestatesToMoviesToolStripMenuItem.Text = "Bind Savestates to Movies";
|
||||
this.bindSavestatesToMoviesToolStripMenuItem.Click += new System.EventHandler(this.bindSavestatesToMoviesToolStripMenuItem_Click);
|
||||
this.acceptBackgroundInputToolStripMenuItem.Name = "acceptBackgroundInputToolStripMenuItem";
|
||||
this.acceptBackgroundInputToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
|
||||
this.acceptBackgroundInputToolStripMenuItem.Text = "Accept Background Input";
|
||||
this.acceptBackgroundInputToolStripMenuItem.Click += new System.EventHandler(this.acceptBackgroundInputToolStripMenuItem_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
|
@ -1651,6 +1660,7 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem screenshotAsToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem runInBackgroundToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem bindSavestatesToMoviesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem acceptBackgroundInputToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -674,5 +674,21 @@ namespace BizHawk.MultiClient
|
|||
|
||||
MakeScreenshot(path);
|
||||
}
|
||||
|
||||
private void runInBackgroundToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.RunInBackground ^= true;
|
||||
}
|
||||
|
||||
private void bindSavestatesToMoviesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.BindSavestatesToMovies ^= true;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -233,7 +233,6 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
for (; ; )
|
||||
{
|
||||
|
||||
Input.Update();
|
||||
CheckHotkeys();
|
||||
|
||||
|
@ -1691,6 +1690,7 @@ namespace BizHawk.MultiClient
|
|||
startPausedToolStripMenuItem.Checked = Global.Config.StartPaused;
|
||||
enableRewindToolStripMenuItem.Checked = Global.Config.RewindEnabled;
|
||||
forceGDIPPresentationToolStripMenuItem.Checked = Global.Config.ForceGDI;
|
||||
acceptBackgroundInputToolStripMenuItem.Checked = Global.Config.AcceptBackgroundInput;
|
||||
}
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
|
@ -1947,15 +1947,5 @@ namespace BizHawk.MultiClient
|
|||
if (!Global.Config.RunInBackground)
|
||||
UnpauseEmulator();
|
||||
}
|
||||
|
||||
private void runInBackgroundToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.RunInBackground ^= true;
|
||||
}
|
||||
|
||||
private void bindSavestatesToMoviesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Global.Config.BindSavestatesToMovies ^= true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue