summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-02-05 20:20:42 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-02-05 20:20:42 +0000
commitd1582a5105f01181535fb859c530e45c2efca071 (patch)
treef8c6939e2c67d64d7be0e2488af296b42f13800d /indra/llwindow
parent57be416ab7c9d93196231fb55de8ba563f3b29eb (diff)
merge -r 57111:57464 maintenance.
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llkeyboardwin32.cpp11
-rw-r--r--indra/llwindow/llwindowwin32.cpp14
2 files changed, 7 insertions, 18 deletions
diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp
index b168c1aed8..448345eeeb 100644
--- a/indra/llwindow/llkeyboardwin32.cpp
+++ b/indra/llwindow/llkeyboardwin32.cpp
@@ -195,7 +195,6 @@ BOOL LLKeyboardWin32::handleKeyDown(const U16 key, MASK mask)
return handled;
}
-
// mask is ignored, except for extended flag -- we poll the modifier keys for the other flags
BOOL LLKeyboardWin32::handleKeyUp(const U16 key, MASK mask)
{
@@ -229,10 +228,14 @@ MASK LLKeyboardWin32::currentMask(BOOL)
void LLKeyboardWin32::scanKeyboard()
{
S32 key;
+ MSG msg;
+ BOOL pending_key_events = PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD);
for (key = 0; key < KEY_COUNT; key++)
{
// On Windows, verify key down state. JC
- if (mKeyLevel[key])
+ // RN: only do this if we don't have further key events in the queue
+ // as otherwise there might be key repeat events still waiting for this key we are now dumping
+ if (!pending_key_events && mKeyLevel[key])
{
// *TODO: I KNOW there must be a better way of
// interrogating the key state than this, using async key
@@ -243,9 +246,9 @@ void LLKeyboardWin32::scanKeyboard()
// ...translate back to windows key
U16 virtual_key = inverseTranslateExtendedKey(key);
// keydown in highest bit
- if (!(GetAsyncKeyState(virtual_key) & 0x8000))
+ if (!pending_key_events && !(GetAsyncKeyState(virtual_key) & 0x8000))
{
- //llinfos << "Key up event missed, resetting" << llendl;
+ //llinfos << "Key up event missed, resetting" << llendl;
mKeyLevel[key] = FALSE;
}
}
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 535f94d855..c79a39c513 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1961,20 +1961,6 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
<< " 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;