Merge "Add onRegisterHoverKey to accessibility delegate"
This commit is contained in:
commit
70a1352cb9
1 changed files with 12 additions and 2 deletions
|
@ -222,13 +222,23 @@ public class KeyboardAccessibilityDelegate<KV extends KeyboardView>
|
||||||
// Make sure we're not getting an EXIT event because the user slid
|
// Make sure we're not getting an EXIT event because the user slid
|
||||||
// off the keyboard area, then force a key press.
|
// off the keyboard area, then force a key press.
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
simulateTouchEvent(MotionEvent.ACTION_DOWN, event);
|
onRegisterHoverKey(key, event);
|
||||||
simulateTouchEvent(MotionEvent.ACTION_UP, event);
|
|
||||||
onHoverExitKey(key);
|
onHoverExitKey(key);
|
||||||
}
|
}
|
||||||
setLastHoverKey(null);
|
setLastHoverKey(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a key that is selected by a hover event
|
||||||
|
*
|
||||||
|
* @param key A key to be registered.
|
||||||
|
* @param event A hover exit event that triggers key registering.
|
||||||
|
*/
|
||||||
|
protected void onRegisterHoverKey(final Key key, final MotionEvent event) {
|
||||||
|
simulateTouchEvent(MotionEvent.ACTION_DOWN, event);
|
||||||
|
simulateTouchEvent(MotionEvent.ACTION_UP, event);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simulating a touch event by injecting a synthesized touch event into {@link PointerTracker}.
|
* Simulating a touch event by injecting a synthesized touch event into {@link PointerTracker}.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue