summaryrefslogtreecommitdiff
path: root/indra/media_plugins
diff options
context:
space:
mode:
authorcallum_linden <none@none>2015-07-02 23:56:19 +0100
committercallum_linden <none@none>2015-07-02 23:56:19 +0100
commitadb0706aa0f3778fda9921172eaabefd3177dbdc (patch)
treec8126334ecc6687165400b57c4d2dd99f6d2ff38 /indra/media_plugins
parent16e750583137743099407d0280c87d2e9da7f551 (diff)
plugin and llceflib code for improved mouse support
Diffstat (limited to 'indra/media_plugins')
-rw-r--r--indra/media_plugins/cef/media_plugin_cef.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp
index 358b35bbe2..ccb8a93f87 100644
--- a/indra/media_plugins/cef/media_plugin_cef.cpp
+++ b/indra/media_plugins/cef/media_plugin_cef.cpp
@@ -339,26 +339,35 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
else if (message_name == "mouse_event")
{
std::string event = message_in.getValue("event");
- //S32 button = message_in.getValueS32("button");
+
S32 x = message_in.getValueS32("x");
S32 y = message_in.getValueS32("y");
//std::string modifiers = message_in.getValue("modifiers");
+ S32 button = message_in.getValueS32("button");
+ EMouseButton btn = MB_MOUSE_BUTTON_LEFT;
+ if (button == 0) btn = MB_MOUSE_BUTTON_LEFT;
+ if (button == 1) btn = MB_MOUSE_BUTTON_RIGHT;
+ if (button == 2) btn = MB_MOUSE_BUTTON_MIDDLE;
+
if (event == "down")
{
- mLLCEFLib->mouseButton(0, true, x, y);
- mLLCEFLib->setFocus(true);
+ mLLCEFLib->mouseButton(btn, ME_MOUSE_DOWN, x, y);
std::stringstream str;
str << "Mouse down at = " << x << ", " << y;
postDebugMessage(str.str());
}
else if (event == "up")
{
- mLLCEFLib->mouseButton(0, false, x, y);
+ mLLCEFLib->mouseButton(btn, ME_MOUSE_UP, x, y);
+ std::stringstream str;
+ str << "Mouse up at = " << x << ", " << y;
+ postDebugMessage(str.str());
}
else if (event == "double_click")
{
+ // TODO: do we need this ?
}
else
{