aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-27 16:03:22 +0900
committerJean Chalard <jchalard@google.com>2014-01-22 14:42:52 +0900
commitb8216a4e7eff303f8803552d47b1e553a7992f5b (patch)
tree3deadec9c77e11d98274dd268ee243121f74f6a1 /java/src
parent2b38b5e8e60900e45a9d5d591ba6f7f7788e535c (diff)
downloadlatinime-b8216a4e7eff303f8803552d47b1e553a7992f5b.tar.gz
latinime-b8216a4e7eff303f8803552d47b1e553a7992f5b.tar.xz
latinime-b8216a4e7eff303f8803552d47b1e553a7992f5b.zip
[IL63] Pull up X,Y processing, step 2
This also fixes the coordinates passed to logOnDelete and log onSeparator. Bug: 8636060 Change-Id: I4703d61ad7de76b501adca18df3a69e06450c9a1
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java40
1 files changed, 20 insertions, 20 deletions
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 35dd97a70..079e65766 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -225,10 +225,25 @@ public final class InputLogic {
}
boolean didAutoCorrect = false;
+ final int keyX, keyY;
+ final Keyboard keyboard = keyboardSwitcher.getKeyboard();
+ final MainKeyboardView mainKeyboardView = keyboardSwitcher.getMainKeyboardView();
+ // TODO: We should reconsider which coordinate system should be used to represent
+ // keyboard event.
+ if (keyboard != null && keyboard.hasProximityCharsCorrection(code)) {
+ // x and y include some padding, but everything down the line (especially native
+ // code) needs the coordinates in the keyboard frame.
+ // TODO: move this frame change up
+ keyX = mainKeyboardView.getKeyX(x);
+ keyY = mainKeyboardView.getKeyY(y);
+ } else {
+ keyX = Constants.NOT_A_COORDINATE;
+ keyY = Constants.NOT_A_COORDINATE;
+ }
switch (code) {
case Constants.CODE_DELETE:
handleBackspace(settingsValues, spaceState, handler, keyboardSwitcher);
- LatinImeLogger.logOnDelete(x, y);
+ LatinImeLogger.logOnDelete(keyX, keyY);
break;
case Constants.CODE_SHIFT:
// Note: Calling back to the keyboard on Shift key is handled in
@@ -289,16 +304,16 @@ public final class InputLogic {
// No action label, and the action from imeOptions is NONE: this is a regular
// enter key that should input a carriage return.
didAutoCorrect = handleNonSpecialCharacter(settingsValues, Constants.CODE_ENTER,
- x, y, spaceState, keyboardSwitcher, handler);
+ keyX, keyY, spaceState, keyboardSwitcher, handler);
}
break;
case Constants.CODE_SHIFT_ENTER:
didAutoCorrect = handleNonSpecialCharacter(settingsValues, Constants.CODE_ENTER,
- x, y, spaceState, keyboardSwitcher, handler);
+ keyX, keyY, spaceState, keyboardSwitcher, handler);
break;
default:
didAutoCorrect = handleNonSpecialCharacter(settingsValues,
- code, x, y, spaceState, keyboardSwitcher, handler);
+ code, keyX, keyY, spaceState, keyboardSwitcher, handler);
break;
}
keyboardSwitcher.onCodeInput(code);
@@ -473,22 +488,7 @@ public final class InputLogic {
commitTyped(settingsValues, LastComposedWord.NOT_A_SEPARATOR);
}
}
- final int keyX, keyY;
- final Keyboard keyboard = keyboardSwitcher.getKeyboard();
- final MainKeyboardView mainKeyboardView = keyboardSwitcher.getMainKeyboardView();
- // TODO: We should reconsider which coordinate system should be used to represent
- // keyboard event.
- if (keyboard != null && keyboard.hasProximityCharsCorrection(codePoint)) {
- // x and y include some padding, but everything down the line (especially native
- // code) needs the coordinates in the keyboard frame.
- // TODO: move this frame change up
- keyX = mainKeyboardView.getKeyX(x);
- keyY = mainKeyboardView.getKeyY(y);
- } else {
- keyX = Constants.NOT_A_COORDINATE;
- keyY = Constants.NOT_A_COORDINATE;
- }
- handleNonSeparator(settingsValues, codePoint, keyX, keyY, spaceState,
+ handleNonSeparator(settingsValues, codePoint, x, y, spaceState,
keyboardSwitcher, handler);
}
return didAutoCorrect;