aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/keyboard/KeyDetector.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/KeyDetector.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyDetector.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyDetector.java b/java/src/com/android/inputmethod/keyboard/KeyDetector.java
index d342c6df0..c2ad56d9f 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyDetector.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyDetector.java
@@ -265,9 +265,9 @@ public class KeyDetector {
for (final Key key: mKeyboard.getNearestKeys(touchX, touchY)) {
final boolean isOnKey = key.isOnKey(touchX, touchY);
final int distance = key.squaredDistanceToEdge(touchX, touchY);
- // TODO: need to take care of hitbox overlaps
+ // To take care of hitbox overlaps, we compare mCode here too.
if (primaryKey == null || distance < minDistance
- || (distance == minDistance && isOnKey)) {
+ || (distance == minDistance && isOnKey && key.mCode > primaryKey.mCode)) {
minDistance = distance;
primaryKey = key;
}