summaryrefslogtreecommitdiff
path: root/indra/llwindow/llkeyboardwin32.cpp
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/llkeyboardwin32.cpp
parent57be416ab7c9d93196231fb55de8ba563f3b29eb (diff)
merge -r 57111:57464 maintenance.
Diffstat (limited to 'indra/llwindow/llkeyboardwin32.cpp')
-rw-r--r--indra/llwindow/llkeyboardwin32.cpp11
1 files changed, 7 insertions, 4 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;
}
}