diff options
author | 2010-09-02 06:02:53 -0700 | |
---|---|---|
committer | 2010-09-02 06:02:53 -0700 | |
commit | e9eda7ea9442300984f0f9510ee189e4b894166d (patch) | |
tree | 56acf5a676331f1bb5374bb1fa95c739aa8f18b5 /java/src/com/android/inputmethod/latin/KeyDetector.java | |
parent | 9b5867e3e6e20a691b3656212d567dd0c5215adb (diff) | |
parent | 7f67c211e7ec4bdf148c9dd468cc8e73ffeb66e3 (diff) | |
download | latinime-e9eda7ea9442300984f0f9510ee189e4b894166d.tar.gz latinime-e9eda7ea9442300984f0f9510ee189e4b894166d.tar.xz latinime-e9eda7ea9442300984f0f9510ee189e4b894166d.zip |
am 7f67c211: am 400046d6: Encapsulate vertical and horizontal correction values into KeyDetector.
Merge commit '7f67c211e7ec4bdf148c9dd468cc8e73ffeb66e3'
* commit '7f67c211e7ec4bdf148c9dd468cc8e73ffeb66e3':
Encapsulate vertical and horizontal correction values into KeyDetector.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/KeyDetector.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/KeyDetector.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyDetector.java b/java/src/com/android/inputmethod/latin/KeyDetector.java index 11d5f861d..5583e3275 100644 --- a/java/src/com/android/inputmethod/latin/KeyDetector.java +++ b/java/src/com/android/inputmethod/latin/KeyDetector.java @@ -25,12 +25,16 @@ abstract class KeyDetector { protected Keyboard mKeyboard; protected Key[] mKeys; + protected int mCorrectionX; + protected int mCorrectionY; protected boolean mProximityCorrectOn; protected int mProximityThresholdSquare; - public Key[] setKeyboard(Keyboard keyboard) { + public Key[] setKeyboard(Keyboard keyboard, float correctionX, float correctionY) { if (keyboard == null) throw new NullPointerException(); + mCorrectionX = (int)correctionX; + mCorrectionY = (int)correctionY; mKeyboard = keyboard; List<Key> keys = mKeyboard.getKeys(); Key[] array = keys.toArray(new Key[keys.size()]); @@ -38,6 +42,14 @@ abstract class KeyDetector { return array; } + protected int getTouchX(int x) { + return x + mCorrectionX; + } + + protected int getTouchY(int y) { + return y + mCorrectionY; + } + public void setProximityCorrectionEnabled(boolean enabled) { mProximityCorrectOn = enabled; } |