From 8ba683f6bd651d15a7572956f76c02d9e63b9e35 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 17 May 2014 02:55:58 +0000 Subject: [PATCH] remove requirement of shift-holding to doubleclick fullscreen toggle.. unless a zapper game is running. --- BizHawk.Client.EmuHawk/MainForm.cs | 15 ++++++++------- BizHawk.Client.EmuHawk/PresentationPanel.cs | 6 ++++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index ac8763255e..164e3de224 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -822,19 +822,20 @@ namespace BizHawk.Client.EmuHawk } } - [System.Runtime.InteropServices.DllImport("user32.dll")] - static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); - - [System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)] - static extern int GetWindowLong(IntPtr hWnd, int nIndex); - public bool IsInFullscreen { get { return _inFullscreen; } } - public void ToggleFullscreen() + public void ToggleFullscreen(bool allowSuppress=false) { + //prohibit this operation if the current controls include LMouse + if (allowSuppress) + { + if (Global.ActiveController.HasBinding("WMouse L")) + return; + } + if (_inFullscreen == false) { SuspendLayout(); diff --git a/BizHawk.Client.EmuHawk/PresentationPanel.cs b/BizHawk.Client.EmuHawk/PresentationPanel.cs index 62e9bf02d7..4b1f647288 100644 --- a/BizHawk.Client.EmuHawk/PresentationPanel.cs +++ b/BizHawk.Client.EmuHawk/PresentationPanel.cs @@ -53,9 +53,11 @@ namespace BizHawk.Client.EmuHawk private void HandleFullscreenToggle(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Left && Control.ModifierKeys == Keys.Shift) + if (e.Button == MouseButtons.Left) { - GlobalWin.MainForm.ToggleFullscreen(); + //allow suppression of the toggle.. but if shift is pressed, always do the toggle + bool allowSuppress = Control.ModifierKeys != Keys.Shift; + GlobalWin.MainForm.ToggleFullscreen(allowSuppress); } }