mirror of
https://github.com/processing/processing4.git
synced 2026-02-09 00:29:22 +01:00
Insert string when it is committed
`inputMethodTextChanged` is called every time when a user is modifying a text on input method support. In the time, code haven't modified yet. Code is modified when the user pressed enter key to decide the input, and only the time `committedCount` becomes non zero.
This commit is contained in:
@@ -184,15 +184,17 @@ public class InputMethodSupport implements InputMethodRequests, InputMethodListe
|
||||
}
|
||||
|
||||
if (text != null) {
|
||||
char[] insertion = new char[committedCount];
|
||||
char c = text.first();
|
||||
for (int i = 0; i < committedCount; i++) {
|
||||
insertion[i] = c;
|
||||
c = text.next();
|
||||
if (committedCount > 0) {
|
||||
char[] insertion = new char[committedCount];
|
||||
char c = text.first();
|
||||
for (int i = 0; i < committedCount; i++) {
|
||||
insertion[i] = c;
|
||||
c = text.next();
|
||||
}
|
||||
// Insert this as a compound edit
|
||||
textArea.setSelectedText(new String(insertion), true);
|
||||
inputHandler.handleInputMethodCommit();
|
||||
}
|
||||
// Insert this as a compound edit
|
||||
textArea.setSelectedText(new String(insertion), true);
|
||||
inputHandler.handleInputMethodCommit();
|
||||
|
||||
CompositionTextPainter compositionPainter = textArea.getPainter().getCompositionTextpainter();
|
||||
if (Base.DEBUG) {
|
||||
|
||||
Reference in New Issue
Block a user