Fix keyboard focus issue on Windows

This commit is contained in:
Henrik Rydgard 2013-10-16 17:20:32 +02:00
parent 87d3903d9f
commit 66e210315b
2 changed files with 3 additions and 6 deletions

View File

@ -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);

View File

@ -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