Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a08a48cb authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi Committed by Android (Google) Code Review
Browse files

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

parents bab08460 b3163ed1
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -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) {