aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/latin/LatinKeyboardView.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-02-05 14:07:04 -0800
committerAmith Yamasani <yamasani@google.com>2010-02-08 15:22:37 -0800
commit1b62ff1a3d61cd44ab88acdfcbdf0fc70a7e1b10 (patch)
tree17739a10acf4f7f9e70b82ba4d0a2f1c17c914b4 /src/com/android/inputmethod/latin/LatinKeyboardView.java
parent8fa317a61a2152347c59dda7eb1b8e2979f6cc1d (diff)
downloadlatinime-1b62ff1a3d61cd44ab88acdfcbdf0fc70a7e1b10.tar.gz
latinime-1b62ff1a3d61cd44ab88acdfcbdf0fc70a7e1b10.tar.xz
latinime-1b62ff1a3d61cd44ab88acdfcbdf0fc70a7e1b10.zip
Increase target size of preferred letters while typing.
This increases the chance of hitting the correct letter when typing a word that exists in the dictionary, rather than only correct it after the fact. It is most effective after 2 or 3 letters of a word have been typed and gets more accurate with more typed letters in the word. If 2 adjacent letters have similar probabilities of occuring, then there is no hit correction applied.
Diffstat (limited to 'src/com/android/inputmethod/latin/LatinKeyboardView.java')
-rw-r--r--src/com/android/inputmethod/latin/LatinKeyboardView.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/inputmethod/latin/LatinKeyboardView.java b/src/com/android/inputmethod/latin/LatinKeyboardView.java
index 05f8aff36..bdac4a5b5 100644
--- a/src/com/android/inputmethod/latin/LatinKeyboardView.java
+++ b/src/com/android/inputmethod/latin/LatinKeyboardView.java
@@ -20,6 +20,7 @@ import java.util.List;
import android.content.Context;
import android.graphics.Canvas;
+import android.graphics.Paint;
import android.inputmethodservice.Keyboard;
import android.inputmethodservice.KeyboardView;
import android.inputmethodservice.Keyboard.Key;
@@ -80,6 +81,11 @@ public class LatinKeyboardView extends KeyboardView {
@Override
public boolean onTouchEvent(MotionEvent me) {
LatinKeyboard keyboard = (LatinKeyboard) getKeyboard();
+ if (DEBUG_LINE) {
+ mLastX = (int) me.getX();
+ mLastY = (int) me.getY();
+ invalidate();
+ }
// Reset any bounding box controls in the keyboard
if (me.getAction() == MotionEvent.ACTION_DOWN) {
keyboard.keyReleased();
@@ -203,6 +209,7 @@ public class LatinKeyboardView extends KeyboardView {
/**************************** INSTRUMENTATION *******************************/
static final boolean DEBUG_AUTO_PLAY = false;
+ static final boolean DEBUG_LINE = false;
private static final int MSG_TOUCH_DOWN = 1;
private static final int MSG_TOUCH_UP = 2;
@@ -213,6 +220,9 @@ public class LatinKeyboardView extends KeyboardView {
private boolean mDownDelivered;
private Key[] mAsciiKeys = new Key[256];
private boolean mPlaying;
+ private int mLastX;
+ private int mLastY;
+ private Paint mPaint;
@Override
public void setKeyboard(Keyboard k) {
@@ -309,5 +319,14 @@ public class LatinKeyboardView extends KeyboardView {
mHandler2.sendEmptyMessageDelayed(MSG_TOUCH_DOWN, 20);
}
}
+ if (DEBUG_LINE) {
+ if (mPaint == null) {
+ mPaint = new Paint();
+ mPaint.setColor(0x80FFFFFF);
+ mPaint.setAntiAlias(false);
+ }
+ c.drawLine(mLastX, 0, mLastX, getHeight(), mPaint);
+ c.drawLine(0, mLastY, getWidth(), mLastY, mPaint);
+ }
}
}