diff options
author | Monroe Linden <monroe@lindenlab.com> | 2009-10-23 14:28:21 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2009-10-23 14:28:21 -0700 |
commit | 376deff7a3c93dc162d047f54f9eed97ad2eba6a (patch) | |
tree | 4d21c90f83b0eba0cf94b215a02e9fb225dffe84 /indra/llplugin/llpluginclassmedia.cpp | |
parent | 4ddaa866dde7a92e56617a32464e0667de3759ef (diff) |
Changes to match new version of llqtwebkit -- passing modifier keys through to most user events and using new scroll wheel event.
Diffstat (limited to 'indra/llplugin/llpluginclassmedia.cpp')
-rw-r--r-- | indra/llplugin/llpluginclassmedia.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index fc58b48a7b..6556aa33a4 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -112,6 +112,8 @@ void LLPluginClassMedia::reset() mLowPrioritySizeLimit = LOW_PRIORITY_TEXTURE_SIZE_DEFAULT; mAllowDownsample = false; mPadding = 0; + mLastMouseX = 0; + mLastMouseY = 0; mStatus = LLPluginClassMediaOwner::MEDIA_NONE; mSleepTime = 1.0f / 100.0f; mCanCut = false; @@ -412,8 +414,20 @@ std::string LLPluginClassMedia::translateModifiers(MASK modifiers) return result; } -void LLPluginClassMedia::mouseEvent(EMouseEventType type, int x, int y, MASK modifiers) +void LLPluginClassMedia::mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers) { + if(type == MOUSE_EVENT_MOVE) + { + if((x == mLastMouseX) && (y == mLastMouseY)) + { + // Don't spam unnecessary mouse move events. + return; + } + + mLastMouseX = x; + mLastMouseY = y; + } + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "mouse_event"); std::string temp; switch(type) @@ -425,6 +439,8 @@ void LLPluginClassMedia::mouseEvent(EMouseEventType type, int x, int y, MASK mod } message.setValue("event", temp); + message.setValueS32("button", button); + message.setValueS32("x", x); // Incoming coordinates are OpenGL-style ((0,0) = lower left), so flip them here if the plugin has requested it. @@ -515,11 +531,12 @@ void LLPluginClassMedia::scrollEvent(int x, int y, MASK modifiers) sendMessage(message); } -bool LLPluginClassMedia::textInput(const std::string &text) +bool LLPluginClassMedia::textInput(const std::string &text, MASK modifiers) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "text_event"); message.setValue("text", text); + message.setValue("modifiers", translateModifiers(modifiers)); sendMessage(message); |