aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-01-22 18:44:48 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-01-22 18:44:48 -0800
commit0f06d8801a141d74e8145a60bc65bcafbf8bf1cb (patch)
treee042c97026ee69ea024723d61532c3951c2d1650 /java/src/com/android/inputmethod/latin/LatinIME.java
parent782bd10489ef82ab521e2ee81afac6d7bb4f304f (diff)
parent352286a43b0f951a5082ca741c2bd7f501f48c81 (diff)
downloadlatinime-0f06d8801a141d74e8145a60bc65bcafbf8bf1cb.tar.gz
latinime-0f06d8801a141d74e8145a60bc65bcafbf8bf1cb.tar.xz
latinime-0f06d8801a141d74e8145a60bc65bcafbf8bf1cb.zip
am 352286a4: [IL64] Pull up X,Y processing, step 3
* commit '352286a43b0f951a5082ca741c2bd7f501f48c81': [IL64] Pull up X,Y processing, step 3
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index d3e6a1bc2..0f40e1365 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1246,8 +1246,24 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Implementation of {@link KeyboardActionListener}.
@Override
- public void onCodeInput(final int primaryCode, final int x, final int y) {
- mInputLogic.onCodeInput(primaryCode, x, y, mHandler, mKeyboardSwitcher, mSubtypeSwitcher);
+ public void onCodeInput(final int codePoint, final int x, final int y) {
+ final int keyX, keyY;
+ final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();
+ final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
+ // x and y include some padding, but everything down the line (especially native
+ // code) needs the coordinates in the keyboard frame.
+ // TODO: We should reconsider which coordinate system should be used to represent
+ // keyboard event. Also we should pull this up -- LatinIME has no business doing
+ // this transformation, it should be done already before calling onCodeInput.
+ if (keyboard != null && keyboard.hasProximityCharsCorrection(codePoint)) {
+ keyX = mainKeyboardView.getKeyX(x);
+ keyY = mainKeyboardView.getKeyY(y);
+ } else {
+ keyX = Constants.NOT_A_COORDINATE;
+ keyY = Constants.NOT_A_COORDINATE;
+ }
+ mInputLogic.onCodeInput(codePoint, keyX, keyY, mHandler, mKeyboardSwitcher,
+ mSubtypeSwitcher);
}
// Called from PointerTracker through the KeyboardActionListener interface