cut toolbar key (#678)

This commit is contained in:
codokie 2024-04-12 18:05:53 +03:00 committed by GitHub
parent 6a9156f0eb
commit f915e46468
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 33 additions and 3 deletions

View file

@ -716,6 +716,15 @@ public final class InputLogic {
case KeyCode.CLIPBOARD_COPY:
mConnection.copyText();
break;
case KeyCode.CLIPBOARD_CUT:
if (mConnection.hasSelection()) {
mConnection.copyText();
final Event backspaceEvent = LatinIME.createSoftwareKeypressEvent(KeyCode.DELETE,
event.getMX(), event.getMY(), event.isKeyRepeat());
handleBackspaceEvent(backspaceEvent, inputTransaction, currentKeyboardScript);
inputTransaction.setDidAffectContents();
}
break;
case KeyCode.ARROW_LEFT:
sendDownUpKeyEvent(KeyEvent.KEYCODE_DPAD_LEFT);
break;