summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2011-03-09 03:31:48 +0000
committerDon Kjer <don@lindenlab.com>2011-03-09 03:31:48 +0000
commit58b393bb1eb2ef15597803741fded4942f3dc647 (patch)
treeb6d572a496658c4d5c2051fb8e187b01a43c48fe /indra
parent127c45dfbab4550ebd7074f131e3a7b844affea8 (diff)
Fix to LLWindow listener keyUp event. Fix to headless client scanKeyboard, allowing input from eventhost
Diffstat (limited to 'indra')
-rw-r--r--indra/llwindow/llkeyboardheadless.cpp25
-rw-r--r--indra/llwindow/llwindowlistener.cpp2
-rw-r--r--indra/newview/llappviewer.cpp4
3 files changed, 27 insertions, 4 deletions
diff --git a/indra/llwindow/llkeyboardheadless.cpp b/indra/llwindow/llkeyboardheadless.cpp
index 4dfaaed4e1..c87617c9ff 100644
--- a/indra/llwindow/llkeyboardheadless.cpp
+++ b/indra/llwindow/llkeyboardheadless.cpp
@@ -46,5 +46,28 @@ MASK LLKeyboardHeadless::currentMask(BOOL for_mouse_event)
{ return MASK_NONE; }
void LLKeyboardHeadless::scanKeyboard()
-{ }
+{
+ for (S32 key = 0; key < KEY_COUNT; key++)
+ {
+ // Generate callback if any event has occurred on this key this frame.
+ // Can't just test mKeyLevel, because this could be a slow frame and
+ // key might have gone down then up. JC
+ if (mKeyLevel[key] || mKeyDown[key] || mKeyUp[key])
+ {
+ mCurScanKey = key;
+ mCallbacks->handleScanKey(key, mKeyDown[key], mKeyUp[key], mKeyLevel[key]);
+ }
+ }
+
+ // Reset edges for next frame
+ for (S32 key = 0; key < KEY_COUNT; key++)
+ {
+ mKeyUp[key] = FALSE;
+ mKeyDown[key] = FALSE;
+ if (mKeyLevel[key])
+ {
+ mKeyLevelFrameCount[key]++;
+ }
+ }
+}
diff --git a/indra/llwindow/llwindowlistener.cpp b/indra/llwindow/llwindowlistener.cpp
index 22cc12acee..59f4c89e34 100644
--- a/indra/llwindow/llwindowlistener.cpp
+++ b/indra/llwindow/llwindowlistener.cpp
@@ -100,7 +100,7 @@ void LLWindowListener::keyUp(LLSD const & evt)
}
// *TODO - figure out how to handle the mask
- mKeyboard->handleTranslatedKeyDown(keycode, 0);
+ mKeyboard->handleTranslatedKeyUp(keycode, 0);
}
void LLWindowListener::mouseDown(LLSD const & evt)
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index f7ec83bea9..d0e1a454fa 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1119,11 +1119,11 @@ bool LLAppViewer::mainLoop()
// Scan keyboard for movement keys. Command keys and typing
// are handled by windows callbacks. Don't do this until we're
// done initializing. JC
- if (gViewerWindow->mWindow->getVisible()
+ if ((gHeadlessClient || gViewerWindow->mWindow->getVisible())
&& gViewerWindow->getActive()
&& !gViewerWindow->mWindow->getMinimized()
&& LLStartUp::getStartupState() == STATE_STARTED
- && !gViewerWindow->getShowProgress()
+ && (gHeadlessClient || !gViewerWindow->getShowProgress())
&& !gFocusMgr.focusLocked())
{
LLMemType mjk(LLMemType::MTYPE_JOY_KEY);