From adb0706aa0f3778fda9921172eaabefd3177dbdc Mon Sep 17 00:00:00 2001 From: callum_linden Date: Thu, 2 Jul 2015 23:56:19 +0100 Subject: plugin and llceflib code for improved mouse support --- indra/media_plugins/cef/media_plugin_cef.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'indra/media_plugins') 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 { -- cgit v1.2.3