diff options
author | Monroe Linden <monroe@lindenlab.com> | 2009-10-21 17:34:07 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2009-10-21 17:34:07 -0700 |
commit | c1583be773e0ceb526428a6abc823dd8cef9ff34 (patch) | |
tree | 9321db026b07299626e049d827ee90dcbaf6d973 /indra/newview | |
parent | 7034a4ef9b4d6d35eeffe439dd32c770fa1ba9e4 (diff) |
Fix for DEV-41542 (hitting Tab at google login on MoaP inserts a character into the password field).
Moved some special-case handling from LLMediaCtrl::handleKeyHere/handleUnicodeCharHere to LLViewerMediaImpl::handleKeyHere/handleUnicodeCharHere so that the key handling for LLViewerMediaFocus gets the benefit of it as well.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llmediactrl.cpp | 36 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 35 |
2 files changed, 36 insertions, 35 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 8005cd1180..15efd0100a 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -321,36 +321,9 @@ BOOL LLMediaCtrl::handleKeyHere( KEY key, MASK mask ) { BOOL result = FALSE; - // FIXME: THIS IS SO WRONG. - // Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it... - if (mMediaSource) { - if( MASK_CONTROL & mask ) - { - if( 'C' == key ) - { - mMediaSource->copy(); - result = TRUE; - } - else - if( 'V' == key ) - { - mMediaSource->paste(); - result = TRUE; - } - else - if( 'X' == key ) - { - mMediaSource->cut(); - result = TRUE; - } - } - - if(!result) - { - result = mMediaSource->handleKeyHere(key, mask); - } + result = mMediaSource->handleKeyHere(key, mask); } return result; @@ -373,12 +346,9 @@ BOOL LLMediaCtrl::handleUnicodeCharHere(llwchar uni_char) { BOOL result = FALSE; - // only accept 'printable' characters, sigh... - if (uni_char >= 32 // discard 'control' characters - && uni_char != 127) // SDL thinks this is 'delete' - yuck. + if (mMediaSource) { - if (mMediaSource) - result = mMediaSource->handleUnicodeCharHere(uni_char); + result = mMediaSource->handleUnicodeCharHere(uni_char); } return result; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index ba3d1914a7..5967b68e51 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1197,7 +1197,33 @@ bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask) if (mMediaSource) { - result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask); + // FIXME: THIS IS SO WRONG. + // Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it... + if( MASK_CONTROL & mask ) + { + if( 'C' == key ) + { + mMediaSource->copy(); + result = true; + } + else + if( 'V' == key ) + { + mMediaSource->paste(); + result = true; + } + else + if( 'X' == key ) + { + mMediaSource->cut(); + result = true; + } + } + + if(!result) + { + result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask); + } } return result; @@ -1210,7 +1236,12 @@ bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char) if (mMediaSource) { - mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char))); + // only accept 'printable' characters, sigh... + if (uni_char >= 32 // discard 'control' characters + && uni_char != 127) // SDL thinks this is 'delete' - yuck. + { + mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char))); + } } return result; |