summaryrefslogtreecommitdiff
path: root/indra/media_plugins
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-01-18 17:58:12 -0800
committerMonroe Linden <monroe@lindenlab.com>2010-01-18 17:58:12 -0800
commitfae9c8fe864278b20dfdb7caae3fbc50c779947b (patch)
treeb85532991ef5ec3d87769aeab053c52918e36089 /indra/media_plugins
parent7590704e0e93b48f897c47dba07916efebd95274 (diff)
Added getNativeKeyData() function to LLWindow and LLWindowMacOSX.
Added an LLSD argument to LLPluginClassMedia::keyEvent() and LLPluginClassMedia::textInput() which contains the native key data. Made LLViewerMediaImpl retrieve the native key data and pass it to keyEvent and textInput. Added a native_key_data parameter to the text_event and key_event messages. Made the webkit plugin extract the native_key_data parameter and pass it to the internal keyEvent() and unicodeInput() functions. Fixed LLMediaPluginTest to match function signature change to LLPluginClassMedia::keyEvent().
Diffstat (limited to 'indra/media_plugins')
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 084cdd9561..3248f1dab5 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -464,7 +464,7 @@ private:
////////////////////////////////////////////////////////////////////////////////
//
- void keyEvent(LLQtWebKit::EKeyEvent key_event, int key, LLQtWebKit::EKeyboardModifier modifiers)
+ void keyEvent(LLQtWebKit::EKeyEvent key_event, int key, LLQtWebKit::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap())
{
int llqt_key;
@@ -515,6 +515,8 @@ private:
}
// std::cerr << "keypress, original code = 0x" << std::hex << key << ", converted code = 0x" << std::hex << llqt_key << std::dec << std::endl;
+
+ std::cerr << "key event " << (int)key_event << ", native_key_data = " << native_key_data << std::endl;
if(llqt_key != 0)
{
@@ -526,10 +528,12 @@ private:
////////////////////////////////////////////////////////////////////////////////
//
- void unicodeInput( const std::string &utf8str, LLQtWebKit::EKeyboardModifier modifiers)
+ void unicodeInput( const std::string &utf8str, LLQtWebKit::EKeyboardModifier modifiers, LLSD native_key_data = LLSD::emptyMap())
{
LLWString wstr = utf8str_to_wstring(utf8str);
+ std::cerr << "unicode input, native_key_data = " << native_key_data << std::endl;
+
unsigned int i;
for(i=0; i < wstr.size(); i++)
{
@@ -843,6 +847,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
std::string event = message_in.getValue("event");
S32 key = message_in.getValueS32("key");
std::string modifiers = message_in.getValue("modifiers");
+ LLSD native_key_data = message_in.getValueLLSD("native_key_data");
// Treat unknown events as key-up for safety.
LLQtWebKit::EKeyEvent key_event = LLQtWebKit::KE_KEY_UP;
@@ -855,14 +860,15 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
key_event = LLQtWebKit::KE_KEY_REPEAT;
}
- keyEvent(key_event, key, decodeModifiers(modifiers));
+ keyEvent(key_event, key, decodeModifiers(modifiers), native_key_data);
}
else if(message_name == "text_event")
{
std::string text = message_in.getValue("text");
std::string modifiers = message_in.getValue("modifiers");
+ LLSD native_key_data = message_in.getValueLLSD("native_key_data");
- unicodeInput(text, decodeModifiers(modifiers));
+ unicodeInput(text, decodeModifiers(modifiers), native_key_data);
}
if(message_name == "edit_cut")
{