Support KEYCODE_{CUT, COPY, PASTE} in TextView.
Bug: 25292652 Change-Id: I8e2c1986e45d9bfd09ab54dea6d2e3701f76df18
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user