aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/TextEntryState.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/TextEntryState.java')
-rw-r--r--java/src/com/android/inputmethod/latin/TextEntryState.java26
1 files changed, 17 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/TextEntryState.java b/java/src/com/android/inputmethod/latin/TextEntryState.java
index 9011191f1..34babdcb5 100644
--- a/java/src/com/android/inputmethod/latin/TextEntryState.java
+++ b/java/src/com/android/inputmethod/latin/TextEntryState.java
@@ -16,8 +16,9 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.keyboard.Key;
+
import android.content.Context;
-import android.inputmethodservice.Keyboard.Key;
import android.text.format.DateFormat;
import android.util.Log;
@@ -61,7 +62,7 @@ public class TextEntryState {
SPACE_AFTER_PICKED,
UNDO_COMMIT,
CORRECTING,
- PICKED_CORRECTION;
+ PICKED_CORRECTION,
}
private static State sState = State.UNKNOWN;
@@ -96,7 +97,7 @@ public class TextEntryState {
}
try {
sKeyLocationFile.close();
- // Write to log file
+ // Write to log file
// Write timestamp, settings,
String out = DateFormat.format("MM:dd hh:mm:ss", Calendar.getInstance().getTime())
.toString()
@@ -168,6 +169,13 @@ public class TextEntryState {
displayState();
}
+ public static void onAbortCorrection() {
+ if (isCorrecting()) {
+ sState = State.START;
+ }
+ displayState();
+ }
+
public static void typedCharacter(char c, boolean isSeparator) {
boolean isSpace = c == ' ';
switch (sState) {
@@ -253,13 +261,13 @@ public class TextEntryState {
}
public static void keyPressedAt(Key key, int x, int y) {
- if (LOGGING && sKeyLocationFile != null && key.codes[0] >= 32) {
- String out =
- "KEY: " + (char) key.codes[0]
- + " X: " + x
+ if (LOGGING && sKeyLocationFile != null && key.mCodes[0] >= 32) {
+ String out =
+ "KEY: " + (char) key.mCodes[0]
+ + " X: " + x
+ " Y: " + y
- + " MX: " + (key.x + key.width / 2)
- + " MY: " + (key.y + key.height / 2)
+ + " MX: " + (key.mX + key.mWidth / 2)
+ + " MY: " + (key.mY + key.mHeight / 2)
+ "\n";
try {
sKeyLocationFile.write(out.getBytes());