author | Ting Li <ting.li@amlogic.com> | 2013-05-03 14:35:54 (GMT) |
---|---|---|
committer | tao.dong <tao.dong@amlogic.com> | 2013-05-08 09:07:49 (GMT) |
commit | 3e7908077a078ef1d415ebca2d504708a5c23f90 (patch) | |
tree | 06d067435488bc22b0e53565ec7279709c32803a | |
parent | eda9e831fce4e35eb0f966378a3d152a1c5e1d8b (diff) | |
download | RemoteIME-3e7908077a078ef1d415ebca2d504708a5c23f90.zip RemoteIME-3e7908077a078ef1d415ebca2d504708a5c23f90.tar.gz RemoteIME-3e7908077a078ef1d415ebca2d504708a5c23f90.tar.bz2 |
pd#72831 change RemoteIME.apk for left_shift_keycode of
'input text string' command
-rwxr-xr-x | src/com/amlogic/inputmethod/remote/EnglishInputProcessor.java | 15 | ||||
-rwxr-xr-x | src/com/amlogic/inputmethod/remote/RemoteIME.java | 12 |
2 files changed, 24 insertions, 3 deletions
diff --git a/src/com/amlogic/inputmethod/remote/EnglishInputProcessor.java b/src/com/amlogic/inputmethod/remote/EnglishInputProcessor.java index 642fc32..bbf829a 100755 --- a/src/com/amlogic/inputmethod/remote/EnglishInputProcessor.java +++ b/src/com/amlogic/inputmethod/remote/EnglishInputProcessor.java @@ -25,7 +25,7 @@ import android.view.inputmethod.InputConnection; public class EnglishInputProcessor { private int mLastKeyCode = KeyEvent.KEYCODE_UNKNOWN; - + private boolean mShiftTag = false; public boolean processKey(InputConnection inputContext, KeyEvent event, boolean upperCase, boolean realAction) { if (null == inputContext || null == event) return false; @@ -35,6 +35,9 @@ public class EnglishInputProcessor { CharSequence prefix = null; prefix = inputContext.getTextBeforeCursor(2, 0); + if (!realAction && keyCode == KeyEvent.KEYCODE_SHIFT_LEFT){ + mShiftTag = true; + } int keyChar; keyChar = 0; if (keyCode >= KeyEvent.KEYCODE_A && keyCode <= KeyEvent.KEYCODE_Z) { @@ -55,6 +58,9 @@ public class EnglishInputProcessor { keyChar = '@'; else if (keyCode == KeyEvent.KEYCODE_SLASH) keyChar = '/'; + if (mShiftTag) { + keyChar = 0; + } if (0 == keyChar) { mLastKeyCode = keyCode; @@ -68,9 +74,14 @@ public class EnglishInputProcessor { } else if (KeyEvent.KEYCODE_SPACE == keyCode) { insert = " "; } else { + if (realAction && keyCode == KeyEvent.KEYCODE_SHIFT_LEFT) + { + mShiftTag = false; + mLastKeyCode = KeyEvent.KEYCODE_UNKNOWN; + } return false; } - + if (null != insert && realAction) inputContext.commitText(insert, insert.length()); diff --git a/src/com/amlogic/inputmethod/remote/RemoteIME.java b/src/com/amlogic/inputmethod/remote/RemoteIME.java index aa6c591..e253798 100755 --- a/src/com/amlogic/inputmethod/remote/RemoteIME.java +++ b/src/com/amlogic/inputmethod/remote/RemoteIME.java @@ -173,6 +173,7 @@ public class RemoteIME extends InputMethodService { private Boolean mEnterEnabled; + private Boolean mShiftTag = false; // receive ringer mode changes private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override @@ -301,6 +302,9 @@ public class RemoteIME extends InputMethodService { return true; } + if (!realAction && keyCode == KeyEvent.KEYCODE_SHIFT_LEFT){ + mShiftTag = true; + } int keyChar = 0; if (keyCode >= KeyEvent.KEYCODE_A && keyCode <= KeyEvent.KEYCODE_Z) { keyChar = keyCode - KeyEvent.KEYCODE_A + 'a'; @@ -316,8 +320,14 @@ public class RemoteIME extends InputMethodService { } else if (keyCode == KeyEvent.KEYCODE_APOSTROPHE) { keyChar = '\''; } + if (mShiftTag) { + keyChar = 0; + } - + if (realAction && keyCode == KeyEvent.KEYCODE_SHIFT_LEFT) + { + mShiftTag = false; + } if (mInputModeSwitcher.isEnglishWithSkb()) { Log.d(TAG, "processKeys: isEnglishWithSkb"); return mImEn.processKey(getCurrentInputConnection(), event, |