diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewermedia.cpp | 37 |
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 | ||