diff options
Diffstat (limited to 'windows.cpp')
-rw-r--r-- | windows.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/windows.cpp b/windows.cpp index ca8bd73979..81290c0da6 100644 --- a/windows.cpp +++ b/windows.cpp @@ -145,6 +145,13 @@ byte veryFastMode; void modifyslot(int sel, int what); +int mapKey(int key) { + if (key>=VK_F1 && key<=VK_F9) { + return key - VK_F1 + 315; + } + return key; +} + static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { WndMan *wm = (WndMan*)GetWindowLong(hWnd, GWL_USERDATA); @@ -157,10 +164,6 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l exit(0); break; - case WM_CHAR: - wm->_scumm->_keyPressed = wParam; - break; - case WM_KEYDOWN: if (wParam>='0' && wParam<='9') { wm->_scumm->_saveLoadSlot = wParam - '0'; @@ -189,6 +192,8 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l wm->_scumm->resourceStats(); } } + + wm->_scumm->_keyPressed = mapKey(wParam); break; case WM_MOUSEMOVE: @@ -918,6 +923,7 @@ void updateScreen(Scumm *s) { void waitForTimer(Scumm *s, int delay) { wm->handleMessage(); if (!veryFastMode) { + assert(delay<500); Sleep(delay*10); } } |