| @@ -933,7 +933,7 @@ public: | |||||
| if (! isTimerRunning()) | if (! isTimerRunning()) | ||||
| startTimer (500); | startTimer (500); | ||||
| } | |||||
| } | |||||
| //============================================================================== | //============================================================================== | ||||
| void handlePaintCallback (jobject canvas, jobject paint) | void handlePaintCallback (jobject canvas, jobject paint) | ||||
| @@ -1628,7 +1628,7 @@ public: | |||||
| void textInputRequired (Point<int>, TextInputTarget&) override {} | void textInputRequired (Point<int>, TextInputTarget&) override {} | ||||
| void dismissPendingTextInput() override | |||||
| void closeInputMethodContext() override | |||||
| { | { | ||||
| stringBeingComposed.clear(); | stringBeingComposed.clear(); | ||||
| const auto* inputContext = [NSTextInputContext currentInputContext]; | const auto* inputContext = [NSTextInputContext currentInputContext]; | ||||
| @@ -1874,9 +1874,14 @@ public: | |||||
| OnScreenKeyboard::getInstance()->activate(); | OnScreenKeyboard::getInstance()->activate(); | ||||
| } | } | ||||
| void dismissPendingTextInput() override | |||||
| void closeInputMethodContext() override | |||||
| { | { | ||||
| imeHandler.handleSetContext (hwnd, false); | imeHandler.handleSetContext (hwnd, false); | ||||
| } | |||||
| void dismissPendingTextInput() override | |||||
| { | |||||
| closeInputMethodContext(); | |||||
| if (uwpViewSettings.isTabletModeActivatedForWindow (hwnd)) | if (uwpViewSettings.isTabletModeActivatedForWindow (hwnd)) | ||||
| OnScreenKeyboard::getInstance()->deactivate(); | OnScreenKeyboard::getInstance()->deactivate(); | ||||
| @@ -1831,7 +1831,7 @@ void TextEditor::mouseDown (const MouseEvent& e) | |||||
| e.mods.isShiftDown()); | e.mods.isShiftDown()); | ||||
| if (auto* peer = getPeer()) | if (auto* peer = getPeer()) | ||||
| peer->dismissPendingTextInput(); | |||||
| peer->closeInputMethodContext(); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -1954,7 +1954,7 @@ bool TextEditor::moveCaretWithTransaction (const int newPos, const bool selectin | |||||
| moveCaretTo (newPos, selecting); | moveCaretTo (newPos, selecting); | ||||
| if (auto* peer = getPeer()) | if (auto* peer = getPeer()) | ||||
| peer->dismissPendingTextInput(); | |||||
| peer->closeInputMethodContext(); | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -267,7 +267,12 @@ TextInputTarget* ComponentPeer::findCurrentTextInputTarget() | |||||
| return nullptr; | return nullptr; | ||||
| } | } | ||||
| void ComponentPeer::dismissPendingTextInput() {} | |||||
| void ComponentPeer::closeInputMethodContext() {} | |||||
| void ComponentPeer::dismissPendingTextInput() | |||||
| { | |||||
| closeInputMethodContext(); | |||||
| } | |||||
| //============================================================================== | //============================================================================== | ||||
| void ComponentPeer::handleBroughtToFront() | void ComponentPeer::handleBroughtToFront() | ||||
| @@ -356,7 +356,16 @@ public: | |||||
| */ | */ | ||||
| virtual void textInputRequired (Point<int> position, TextInputTarget&) = 0; | virtual void textInputRequired (Point<int> position, TextInputTarget&) = 0; | ||||
| /** If there's some kind of OS input-method in progress, this should dismiss it. */ | |||||
| /** If there's a currently active input-method context - i.e. characters are being | |||||
| composed using multiple keystrokes - this should commit the current state of the | |||||
| context to the text and clear the context. | |||||
| */ | |||||
| virtual void closeInputMethodContext(); | |||||
| /** If there's some kind of OS input-method in progress, this should dismiss it. | |||||
| Overrides of this function should call closeInputMethodContext(). | |||||
| */ | |||||
| virtual void dismissPendingTextInput(); | virtual void dismissPendingTextInput(); | ||||
| /** Returns the currently focused TextInputTarget, or null if none is found. */ | /** Returns the currently focused TextInputTarget, or null if none is found. */ | ||||