summaryrefslogtreecommitdiff
path: root/indra/llwindow/llkeyboard.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-01-09 20:19:31 +0000
committerJosh Bell <josh@lindenlab.com>2007-01-09 20:19:31 +0000
commit8c344f4da02105428c5933501d028a4a8908a657 (patch)
tree1463f67247c48a7420620917aa7fde5d6a810820 /indra/llwindow/llkeyboard.cpp
parent8534623734e64387736ddb76683939104d796ade (diff)
svn merge -r 56560:56599 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance
Diffstat (limited to 'indra/llwindow/llkeyboard.cpp')
-rw-r--r--indra/llwindow/llkeyboard.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp
index ee42f53571..a0970f0140 100644
--- a/indra/llwindow/llkeyboard.cpp
+++ b/indra/llwindow/llkeyboard.cpp
@@ -205,6 +205,8 @@ BOOL LLKeyboard::handleTranslatedKeyDown(KEY translated_key, U32 translated_mask
{
mKeyLevel[translated_key] = TRUE;
mKeyLevelTimer[translated_key].reset();
+ mKeyLevelFrameCount[translated_key] = 0;
+ mKeyRepeated[translated_key] = FALSE;
}
else
{
@@ -226,7 +228,6 @@ BOOL LLKeyboard::handleTranslatedKeyUp(KEY translated_key, U32 translated_mask)
if( mKeyLevel[translated_key] )
{
mKeyLevel[translated_key] = FALSE;
- mKeyLevelFrameCount[translated_key] = 0;
// Only generate key up events if the key is thought to
// be down. This allows you to call resetKeys() in the
@@ -234,7 +235,6 @@ BOOL LLKeyboard::handleTranslatedKeyUp(KEY translated_key, U32 translated_mask)
// messages in the same frame. This was causing the
// sequence W<return> in chat to move agents forward. JC
mKeyUp[translated_key] = TRUE;
- mKeyRepeated[translated_key] = FALSE;
handled = mCallbacks->handleTranslatedKeyUp(translated_key, translated_mask);
}
@@ -260,27 +260,13 @@ void LLKeyboard::toggleInsertMode()
// Returns time in seconds since key was pressed.
F32 LLKeyboard::getKeyElapsedTime(KEY key)
{
- if( mKeyLevel[key] )
- {
- return mKeyLevelTimer[key].getElapsedTimeF32();
- }
- else
- {
- return 0.f;
- }
+ return mKeyLevelTimer[key].getElapsedTimeF32();
}
// Returns time in frames since key was pressed.
S32 LLKeyboard::getKeyElapsedFrameCount(KEY key)
{
- if( mKeyLevel[key] )
- {
- return mKeyLevelFrameCount[key];
- }
- else
- {
- return 0;
- }
+ return mKeyLevelFrameCount[key];
}
// static