aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2010-08-25 21:27:13 +0900
committersatok <satok@google.com>2010-08-26 18:08:12 +0900
commit542f057ef64ae16cf2bc528880cf32bfd073edad (patch)
tree16f6c0f0c753f0b4caff4a293b7c9b174149f91d /java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
parent0c5480989186c884a1a296ac2f46132235d02d45 (diff)
downloadlatinime-542f057ef64ae16cf2bc528880cf32bfd073edad.tar.gz
latinime-542f057ef64ae16cf2bc528880cf32bfd073edad.tar.xz
latinime-542f057ef64ae16cf2bc528880cf32bfd073edad.zip
Add a log for getting coordinates of keys
Change-Id: I57cc6fb6a9eeb65ce8c0c3c3262fd525726643e2
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
index 8a8a12c80..7247632c3 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
@@ -100,8 +100,14 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
* keys. These codes are useful to correct for
* accidental presses of a key adjacent to the intended
* key.
+ * @param x
+ * x-coordinate pixel of touched event. If onKey is not called by onTouchEvent,
+ * the value should be NOT_A_TOUCH_COORDINATE.
+ * @param y
+ * y-coordinate pixel of touched event. If onKey is not called by onTouchEvent,
+ * the value should be NOT_A_TOUCH_COORDINATE.
*/
- void onKey(int primaryCode, int[] keyCodes);
+ void onKey(int primaryCode, int[] keyCodes, int x, int y);
/**
* Sends a sequence of characters to the listener.
@@ -134,6 +140,8 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
void swipeUp();
}
+ public static final int NOT_A_TOUCH_COORDINATE = -1;
+
private static final boolean DEBUG = false;
private static final int NOT_A_KEY = -1;
private static final int[] KEY_DELETE = { Keyboard.KEYCODE_DELETE };
@@ -614,6 +622,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
mHandler.cancelKeyTimers();
mHandler.cancelPopupPreview();
mKeyboard = keyboard;
+ LatinImeLogger.onSetKeyboard(mKeyboard);
List<Key> keys = mKeyboard.getKeys();
mKeys = keys.toArray(new Key[keys.size()]);
requestLayout();
@@ -975,7 +984,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
// Multi-tap
if (mInMultiTap) {
if (mTapCount != -1) {
- mKeyboardActionListener.onKey(Keyboard.KEYCODE_DELETE, KEY_DELETE);
+ mKeyboardActionListener.onKey(Keyboard.KEYCODE_DELETE, KEY_DELETE, x, y);
} else {
mTapCount = 0;
}
@@ -990,7 +999,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
codes[1] = codes[0];
codes[0] = code;
}
- mKeyboardActionListener.onKey(code, codes);
+ mKeyboardActionListener.onKey(code, codes, x, y);
mKeyboardActionListener.onRelease(code);
}
mLastSentIndex = index;
@@ -1198,8 +1207,8 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
R.id.closeButton);
if (closeButton != null) closeButton.setOnClickListener(this);
mMiniKeyboard.setOnKeyboardActionListener(new OnKeyboardActionListener() {
- public void onKey(int primaryCode, int[] keyCodes) {
- mKeyboardActionListener.onKey(primaryCode, keyCodes);
+ public void onKey(int primaryCode, int[] keyCodes, int x, int y) {
+ mKeyboardActionListener.onKey(primaryCode, keyCodes, x, y);
dismissPopupKeyboard();
}