diff --git a/java/src/com/android/inputmethod/keyboard/KeyDetector.java b/java/src/com/android/inputmethod/keyboard/KeyDetector.java
index 10cf1d1..3638eae 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyDetector.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyDetector.java
@@ -65,11 +65,11 @@
         return mKeyHysteresisDistanceSquared;
     }
 
-    protected int getTouchX(int x) {
+    public int getTouchX(int x) {
         return x + mCorrectionX;
     }
 
-    protected int getTouchY(int y) {
+    public int getTouchY(int y) {
         return y + mCorrectionY;
     }
 
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index 2a597b8..3324a37 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -123,21 +123,27 @@
     }
 
     // TODO: remove input keyDetector
-    public void add(int primaryCode, int keyX, int keyY, KeyDetector keyDetector) {
+    public void add(int primaryCode, int x, int y, KeyDetector keyDetector) {
         final int[] codes;
-        if (keyX == KeyboardActionListener.SPELL_CHECKER_COORDINATE
-                || keyY == KeyboardActionListener.SPELL_CHECKER_COORDINATE) {
+        final int keyX;
+        final int keyY;
+        if (x == KeyboardActionListener.SPELL_CHECKER_COORDINATE
+                || y == KeyboardActionListener.SPELL_CHECKER_COORDINATE) {
             // only used for tests in InputLogicTests
             addKeyForSpellChecker(primaryCode, AndroidSpellCheckerService.SCRIPT_LATIN);
             return;
-        } else if (keyX == KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
-                || keyY == KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
-                || keyX == KeyboardActionListener.NOT_A_TOUCH_COORDINATE
-                || keyY == KeyboardActionListener.NOT_A_TOUCH_COORDINATE) {
+        } else if (x == KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
+                || y == KeyboardActionListener.SUGGESTION_STRIP_COORDINATE
+                || x == KeyboardActionListener.NOT_A_TOUCH_COORDINATE
+                || y == KeyboardActionListener.NOT_A_TOUCH_COORDINATE) {
             codes = new int[] { primaryCode };
+            keyX = x;
+            keyY = y;
         } else {
             codes = keyDetector.newCodeArray();
-            keyDetector.getKeyAndNearbyCodes(keyX, keyY, codes);
+            keyDetector.getKeyAndNearbyCodes(x, y, codes);
+            keyX = keyDetector.getTouchX(x);
+            keyY = keyDetector.getTouchX(y);
         }
         add(primaryCode, codes, keyX, keyY);
     }
