From: Toni Wilen Date: Sat, 11 Feb 2023 09:01:48 +0000 (+0200) Subject: When GUI is open: emulation window ESC=close GUI. F12/left mouse doubleclick=Bring... X-Git-Tag: 5.0.0~150 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=ce1c90ec78d39a3c9a1e1c6bb2da84eb893e5bcc;p=francis%2Fwinuae.git When GUI is open: emulation window ESC=close GUI. F12/left mouse doubleclick=Bring GUI on top. --- diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 6578aeb8..3f1b304b 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include "resource.h" @@ -1970,8 +1971,18 @@ static LRESULT CALLBACK AmigaWindowProc(HWND hWnd, UINT message, WPARAM wParam, return 0; case WM_KEYDOWN: - if (dinput_wmkey((uae_u32)lParam)) - inputdevice_add_inputcode(AKS_ENTERGUI, 1, NULL); + if (!hGUIWnd) { + if (dinput_wmkey((uae_u32)lParam)) { + inputdevice_add_inputcode(AKS_ENTERGUI, 1, NULL); + } + } else { + int scancode = (lParam >> 16) & 0xff; + if (((currprefs.win32_guikey > 0 && scancode == currprefs.win32_guikey) || (currprefs.win32_guikey < 0 && scancode == DIK_F12))) { + SetForegroundWindow(hGUIWnd); + } else if (wParam == VK_ESCAPE) { + SendMessage(hGUIWnd, WM_CLOSE, 0, 0); + } + } return 0; case WM_LBUTTONUP: @@ -2003,7 +2014,11 @@ static LRESULT CALLBACK AmigaWindowProc(HWND hWnd, UINT message, WPARAM wParam, } else if (dinput_winmouse() >= 0 && isfocus()) { if (log_winmouse) write_log(_T("WM_LBUTTONDOWN\n")); - setmousebuttonstate(dinput_winmouse(), 0, 1); + if (message == WM_LBUTTONDBLCLK && hGUIWnd) { + SetForegroundWindow(hGUIWnd); + } else { + setmousebuttonstate(dinput_winmouse(), 0, 1); + } } } return 0;