From 821f998373c59dac9212f91ec967f39ed081663a Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 25 Jan 2007 00:18:16 +0000 Subject: merge -r 57058:57111 maintenance. --- indra/llwindow/llwindowwin32.cpp | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index daa1a26b3d..42a88b6cc3 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1950,19 +1950,34 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ // allow system keys, such as ALT-F4 to be processed by Windows eat_keystroke = FALSE; case WM_KEYDOWN: - if (gDebugWindowProc) - { - llinfos << "Debug WindowProc WM_KEYDOWN " - << " key " << S32(w_param) - << llendl; - } - if (gKeyboard->handleKeyDown(w_param, mask) && eat_keystroke) { - return 0; + if (gDebugWindowProc) + { + llinfos << "Debug WindowProc WM_KEYDOWN " + << " key " << S32(w_param) + << llendl; + } + // lower 15 bits hold key repeat count + S32 key_repeat_count = l_param & 0x7fff; + if (key_repeat_count > 1) + { + KEY translated_key; + gKeyboard->translateKey(w_param, &translated_key); + if (!gKeyboard->getKeyDown(translated_key)) + { + //RN: hack for handling key repeats when we no longer recognize the key as being down + //This is necessary because we sometimes ignore the message queue and use getAsyncKeyState + // to clear key level flags before we've processed all key repeat messages + return 0; + } + } + if(gKeyboard->handleKeyDown(w_param, mask) && eat_keystroke) + { + return 0; + } + // pass on to windows if we didn't handle it + break; } - // pass on to windows if we didn't handle it - break; - case WM_SYSKEYUP: eat_keystroke = FALSE; case WM_KEYUP: -- cgit v1.2.3