Index: app/src/processing/app/syntax/im/CompositionTextManager.java =================================================================== --- app/src/processing/app/syntax/im/CompositionTextManager.java (revision 6686) +++ app/src/processing/app/syntax/im/CompositionTextManager.java (working copy) @@ -54,6 +54,18 @@ public boolean getIsInputProcess() { return isInputProcess; } + /** + * Insert full width space + */ + public void insertFullWidthSpace() { + initialCaretPosition = textArea.getCaretPosition(); + int layoutCaretPosition = initialCaretPosition; + try { + textArea.getDocument().insertString(layoutCaretPosition, "\u3000", null); + } catch (BadLocationException e) { + e.printStackTrace(); + } + } /** * Called when a user begins input from input method. @@ -115,7 +127,6 @@ * @param commited_count Numbers of committed characters in text. */ public void endCompositionText(AttributedCharacterIterator text, int committed_count) { - isInputProcess = false; /* * If there are no committed characters, remove it all from textarea. * This case will happen if a user delete all composing characters by backspace or delete key. Index: app/src/processing/app/syntax/im/InputMethodSupport.java =================================================================== --- app/src/processing/app/syntax/im/InputMethodSupport.java (revision 6686) +++ app/src/processing/app/syntax/im/InputMethodSupport.java (working copy) @@ -73,6 +73,11 @@ public void inputMethodTextChanged(InputMethodEvent event) { AttributedCharacterIterator text = event.getText(); committed_count = event.getCommittedCharacterCount(); + if(isFullWidthSpaceInput(text)){ + textManager.insertFullWidthSpace(); + caretPositionChanged(event); + return; + } if(isBeginInputProcess(text, textManager)){ textManager.beginCompositionText(text, committed_count); caretPositionChanged(event); @@ -86,11 +91,21 @@ textManager.endCompositionText(text, committed_count); caretPositionChanged(event); } - + + private boolean isFullWidthSpaceInput(AttributedCharacterIterator text){ + if(text == null) + return false; + if(textManager.getIsInputProcess()) + return false; + return (String.valueOf(text.first()).equals("\u3000")); + } + private boolean isBeginInputProcess(AttributedCharacterIterator text, CompositionTextManager textManager){ if(text == null) return false; - return (isInputProcess(text) && !textManager.getIsInputProcess()); + if(textManager.getIsInputProcess()) + return false; + return (isInputProcess(text)); } private boolean isInputProcess(AttributedCharacterIterator text){