diff options
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r-- | indra/llui/lllineeditor.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 7e7999c9f9..5e043ecea3 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -200,6 +200,9 @@ LLString LLLineEditor::getWidgetTag() const void LLLineEditor::onFocusLost() { + // Need to notify early when loosing focus. + getWindow()->allowLanguageTextInput(FALSE); + LLUICtrl::onFocusLost(); if( mCommitOnFocusLost && mText.getString() != mPrevText) @@ -1110,7 +1113,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) // handle ctrl-uparrow if we have a history enabled line editor. case KEY_UP: - if( mHaveHistory && ( MASK_CONTROL & mask ) ) + if( mHaveHistory && ( MASK_CONTROL == mask ) ) { if( mCurrentHistoryLine > 0 ) { @@ -1127,7 +1130,7 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) // handle ctrl-downarrow if we have a history enabled line editor case KEY_DOWN: - if( mHaveHistory && ( MASK_CONTROL & mask ) ) + if( mHaveHistory && ( MASK_CONTROL == mask ) ) { if( !mLineHistory.empty() && mCurrentHistoryLine < mLineHistory.size() - 1 ) { @@ -1626,6 +1629,12 @@ void LLLineEditor::setFocus( BOOL new_state ) { BOOL old_state = hasFocus(); + if (!new_state) + { + getWindow()->allowLanguageTextInput(FALSE); + } + + // getting focus when we didn't have it before, and we want to select all if (!old_state && new_state && mSelectAllonFocusReceived) { @@ -1656,6 +1665,16 @@ void LLLineEditor::setFocus( BOOL new_state ) } LLUICtrl::setFocus( new_state ); + + if (new_state) + { + // Allow Language Text Input only when this LineEditor has + // no prevalidate function attached. This criterion works + // fine on 1.15.0.2, since all prevalidate func reject any + // non-ASCII characters. I'm not sure on future versions, + // however. + getWindow()->allowLanguageTextInput(mPrevalidateFunc == NULL); + } } //virtual |