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

Commit b3163ed1 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi
Browse files

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

Bug: 25292652
Change-Id: I8e2c1986e45d9bfd09ab54dea6d2e3701f76df18
parent 742bd403
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) {