Support KEYCODE_{CUT, COPY, PASTE} in TextView.

Bug: 25292652
Change-Id: I8e2c1986e45d9bfd09ab54dea6d2e3701f76df18
This commit is contained in:
Keisuke Kuroyanagi
2015-10-28 14:27:00 +09:00
parent 742bd40328
commit b3163ed118

View File

@@ -6118,6 +6118,30 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
return -1;
}
break;
case KeyEvent.KEYCODE_CUT:
if (event.hasNoModifiers() && canCut()) {
if (onTextContextMenuItem(ID_CUT)) {
return -1;
}
}
break;
case KeyEvent.KEYCODE_COPY:
if (event.hasNoModifiers() && canCopy()) {
if (onTextContextMenuItem(ID_COPY)) {
return -1;
}
}
break;
case KeyEvent.KEYCODE_PASTE:
if (event.hasNoModifiers() && canPaste()) {
if (onTextContextMenuItem(ID_PASTE)) {
return -1;
}
}
break;
}
if (mEditor != null && mEditor.mKeyListener != null) {