aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
authorArmin Weatherwax2010-02-26 17:06:16 +0100
committerArmin Weatherwax2010-09-23 15:40:22 +0200
commitdcdfa1ebab37dd78282bc95093a5f347f5846b1c (patch)
tree22d6ea3f35b749e51ae4ac882bd56f42d35f9590 /linden/indra/newview
parentremove deprecated files (diff)
downloadmeta-impy-dcdfa1ebab37dd78282bc95093a5f347f5846b1c.zip
meta-impy-dcdfa1ebab37dd78282bc95093a5f347f5846b1c.tar.gz
meta-impy-dcdfa1ebab37dd78282bc95093a5f347f5846b1c.tar.bz2
meta-impy-dcdfa1ebab37dd78282bc95093a5f347f5846b1c.tar.xz
port SG2.0 Mediaplugs (webkit supports flash now)
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/llviewermedia.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp
index 5bdb26f..c0d1460 100644
--- a/linden/indra/newview/llviewermedia.cpp
+++ b/linden/indra/newview/llviewermedia.cpp
@@ -770,7 +770,38 @@ bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask)
770 770
771 if (mMediaSource) 771 if (mMediaSource)
772 { 772 {
773 result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask); 773 // FIXME: THIS IS SO WRONG.
774 // Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it...
775 if( MASK_CONTROL & mask )
776 {
777 if( 'C' == key )
778 {
779 mMediaSource->copy();
780 result = true;
781 }
782 else
783 if( 'V' == key )
784 {
785 mMediaSource->paste();
786 result = true;
787 }
788 else
789 if( 'X' == key )
790 {
791 mMediaSource->cut();
792 result = true;
793 }
794 }
795
796 if(!result)
797 {
798
799 LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
800
801 result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask, native_key_data);
802 // Since the viewer internal event dispatching doesn't give us key-up events, simulate one here.
803 (void)mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_UP ,key, mask, native_key_data);
804 }
774 } 805 }
775 806
776 return result; 807 return result;
@@ -787,7 +818,9 @@ bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char)
787 if (uni_char >= 32 // discard 'control' characters 818 if (uni_char >= 32 // discard 'control' characters
788 && uni_char != 127) // SDL thinks this is 'delete' - yuck. 819 && uni_char != 127) // SDL thinks this is 'delete' - yuck.
789 { 820 {
790 mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(FALSE)); 821 LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
822
823 mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(FALSE), native_key_data);
791 } 824 }
792 } 825 }
793 826