From bdd5c80fcac164213a035e80e9599b91fca12f57 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Mon, 9 May 2016 15:39:11 +0200 Subject: [PATCH] Commit the text on finishComposingText() This handles e.g. text written with hand writing input methods as mentioned in #91. --- .../java/com/termux/view/TerminalView.java | 37 +++---------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/app/src/main/java/com/termux/view/TerminalView.java b/app/src/main/java/com/termux/view/TerminalView.java index 75f7e2a8ad..638b575612 100644 --- a/app/src/main/java/com/termux/view/TerminalView.java +++ b/app/src/main/java/com/termux/view/TerminalView.java @@ -258,43 +258,18 @@ public boolean beginBatchEdit() { return true; } - @Override - public boolean clearMetaKeyStates(int states) { - if (LOG_KEY_EVENTS) Log.i(EmulatorDebug.LOG_TAG, "IME: clearMetaKeyStates(" + states + ")"); - return true; - } - @Override public boolean endBatchEdit() { if (LOG_KEY_EVENTS) Log.i(EmulatorDebug.LOG_TAG, "IME: endBatchEdit()"); return false; } - @Override - public boolean finishComposingText() { - if (LOG_KEY_EVENTS) Log.i(EmulatorDebug.LOG_TAG, "IME: finishComposingText()"); - return true; - } - - @Override - public int getCursorCapsMode(int reqModes) { - if (LOG_KEY_EVENTS) Log.i(EmulatorDebug.LOG_TAG, "IME: getCursorCapsMode(" + reqModes + ")"); - int mode = 0; - if ((reqModes & TextUtils.CAP_MODE_CHARACTERS) != 0) { - mode |= TextUtils.CAP_MODE_CHARACTERS; - } - return mode; - } - - @Override - public CharSequence getTextAfterCursor(int n, int flags) { - return ""; - } - - @Override - public CharSequence getTextBeforeCursor(int n, int flags) { - return ""; - } + @Override + public boolean finishComposingText() { + if (LOG_KEY_EVENTS) Log.i(EmulatorDebug.LOG_TAG, "IME: finishComposingText()"); + commitText(getEditable(), 0); + return true; + } @Override public boolean commitText(CharSequence text, int newCursorPosition) {