summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-05-22 19:46:57 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2012-05-22 19:47:02 -0700
commitb6a0b09bf570679587f1875ef336dfe676ea8ebe (patch)
tree4367dba59136ded26c3646574568753caea0ec73 /core/java
parentc00d00865d51e8c08d1f90b2b34c699b63a7105e (diff)
Interaction model of KeyboarView should be same as latimIME
1. In latin IME key up types in - now the keyboad view does the same. bug:6534935 Change-Id: I91cd40c5cd541199f3fb43e4d0bf26be511dcd09
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/inputmethodservice/KeyboardView.java35
1 files changed, 20 insertions, 15 deletions
diff --git a/core/java/android/inputmethodservice/KeyboardView.java b/core/java/android/inputmethodservice/KeyboardView.java
index 72575217fbd2..491624409826 100644
--- a/core/java/android/inputmethodservice/KeyboardView.java
+++ b/core/java/android/inputmethodservice/KeyboardView.java
@@ -855,15 +855,23 @@ public class KeyboardView extends View implements View.OnClickListener {
Key oldKey = keys[oldKeyIndex];
oldKey.onReleased(mCurrentKeyIndex == NOT_A_KEY);
invalidateKey(oldKeyIndex);
+ final int keyCode = oldKey.codes[0];
sendAccessibilityEventForUnicodeCharacter(AccessibilityEvent.TYPE_VIEW_HOVER_EXIT,
- oldKey.codes[0]);
+ keyCode);
+ // TODO: We need to implement AccessibilityNodeProvider for this view.
+ sendAccessibilityEventForUnicodeCharacter(
+ AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED, keyCode);
}
if (mCurrentKeyIndex != NOT_A_KEY && keys.length > mCurrentKeyIndex) {
Key newKey = keys[mCurrentKeyIndex];
newKey.onPressed();
invalidateKey(mCurrentKeyIndex);
+ final int keyCode = newKey.codes[0];
sendAccessibilityEventForUnicodeCharacter(AccessibilityEvent.TYPE_VIEW_HOVER_ENTER,
- newKey.codes[0]);
+ keyCode);
+ // TODO: We need to implement AccessibilityNodeProvider for this view.
+ sendAccessibilityEventForUnicodeCharacter(
+ AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED, keyCode);
}
}
// If key changed and preview is on ...
@@ -1154,20 +1162,17 @@ public class KeyboardView extends View implements View.OnClickListener {
if (mAccessibilityManager.isTouchExplorationEnabled() && event.getPointerCount() == 1) {
final int action = event.getAction();
switch (action) {
- case MotionEvent.ACTION_HOVER_ENTER:
- case MotionEvent.ACTION_HOVER_MOVE:
- final int touchX = (int) event.getX() - mPaddingLeft;
- int touchY = (int) event.getY() - mPaddingTop;
- if (touchY >= -mVerticalCorrection) {
- touchY += mVerticalCorrection;
- }
- final int keyIndex = getKeyIndices(touchX, touchY, null);
- showPreview(keyIndex);
- break;
- case MotionEvent.ACTION_HOVER_EXIT:
- showPreview(NOT_A_KEY);
- break;
+ case MotionEvent.ACTION_HOVER_ENTER: {
+ event.setAction(MotionEvent.ACTION_DOWN);
+ } break;
+ case MotionEvent.ACTION_HOVER_MOVE: {
+ event.setAction(MotionEvent.ACTION_MOVE);
+ } break;
+ case MotionEvent.ACTION_HOVER_EXIT: {
+ event.setAction(MotionEvent.ACTION_UP);
+ } break;
}
+ return onTouchEvent(event);
}
return true;
}