From 542f057ef64ae16cf2bc528880cf32bfd073edad Mon Sep 17 00:00:00 2001 From: satok Date: Wed, 25 Aug 2010 21:27:13 +0900 Subject: Add a log for getting coordinates of keys Change-Id: I57cc6fb6a9eeb65ce8c0c3c3262fd525726643e2 --- .../android/inputmethod/latin/LatinKeyboardView.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardView.java') diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java index 38d9cefb1..e57abd2c5 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java @@ -96,15 +96,21 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { @Override protected boolean onLongPress(Key key) { if (key.codes[0] == Keyboard.KEYCODE_MODE_CHANGE) { - getOnKeyboardActionListener().onKey(KEYCODE_OPTIONS, null); + getOnKeyboardActionListener().onKey(KEYCODE_OPTIONS, null, + LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE, + LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE); return true; } else if (key.codes[0] == Keyboard.KEYCODE_SHIFT) { - getOnKeyboardActionListener().onKey(KEYCODE_SHIFT_LONGPRESS, null); + getOnKeyboardActionListener().onKey(KEYCODE_SHIFT_LONGPRESS, null, + LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE, + LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE); invalidateAllKeys(); return true; } else if (key.codes[0] == '0' && getKeyboard() == mPhoneKeyboard) { // Long pressing on 0 in phone number keypad gives you a '+'. - getOnKeyboardActionListener().onKey('+', null); + getOnKeyboardActionListener().onKey( + '+', null, LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE, + LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE); return true; } else { return super.onLongPress(key); @@ -235,7 +241,7 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { if (languageDirection != 0) { getOnKeyboardActionListener().onKey( languageDirection == 1 ? KEYCODE_NEXT_LANGUAGE : KEYCODE_PREV_LANGUAGE, - null); + null, mLastX, mLastY); me.setAction(MotionEvent.ACTION_CANCEL); keyboard.keyReleased(); return super.onTouchEvent(me); @@ -366,8 +372,8 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { ExtensionKeyboardListener(OnKeyboardActionListener target) { mTarget = target; } - public void onKey(int primaryCode, int[] keyCodes) { - mTarget.onKey(primaryCode, keyCodes); + public void onKey(int primaryCode, int[] keyCodes, int x, int y) { + mTarget.onKey(primaryCode, keyCodes, x, y); } public void onPress(int primaryCode) { mTarget.onPress(primaryCode); -- cgit v1.2.3-83-g751a