From 66e210315b027460e3a3ded9059f90718baa77c6 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Wed, 16 Oct 2013 17:20:32 +0200 Subject: [PATCH] Fix keyboard focus issue on Windows --- Windows/WndMainWindow.cpp | 7 +++---- Windows/main.cpp | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 2f5b7d1fd6..8ad435a9a3 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -82,7 +82,7 @@ extern InputState input_state; #define TIMER_CURSORUPDATE 1 #define TIMER_CURSORMOVEUPDATE 2 -#define CURSORUPDATE_INTERVAL_MS 50 +#define CURSORUPDATE_INTERVAL_MS 1000 #define CURSORUPDATE_MOVE_TIMESPAN_MS 500 #ifndef HID_USAGE_PAGE_GENERIC @@ -819,8 +819,7 @@ namespace MainWindow dev[1].dwFlags = 0; RegisterRawInputDevices(dev, 2, sizeof(RAWINPUTDEVICE)); - SetFocus(hwndDisplay); - + SetFocus(hwndMain); return TRUE; } @@ -854,7 +853,7 @@ namespace MainWindow } if (browseDirectory) { - std::string dir = W32Util::BrowseForFolder(GetHWND(),"Choose directory"); + std::string dir = W32Util::BrowseForFolder(GetHWND(), "Choose directory"); if (dir == "") { if (!isPaused) Core_EnableStepping(false); diff --git a/Windows/main.cpp b/Windows/main.cpp index 1b831d968b..9fe3efbae1 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -306,8 +306,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin //so.. we're at the message pump of the GUI thread for (MSG msg; GetMessage(&msg, NULL, 0, 0); ) // for no quit { - //DSound_UpdateSound(); - if (msg.message == WM_KEYDOWN) { //hack to enable/disable menu command accelerate keys