From: Po Lu Date: Sat, 3 Jun 2023 07:08:05 +0000 (+0800) Subject: Fix typos in Android port X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a4bf3ad95869771afb4b8c64d14fa145348e4d2b;p=emacs.git Fix typos in Android port * lisp/bindings.el (global-map): Bind cut, copy and paste. * src/androidterm.c (JNICALL): Use key. --- diff --git a/lisp/bindings.el b/lisp/bindings.el index eec51a4e413..75d22bf9b25 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -1202,6 +1202,10 @@ if `inhibit-field-text-motion' is non-nil." (define-key global-map [insertchar] 'overwrite-mode) (define-key global-map [C-insertchar] 'kill-ring-save) (define-key global-map [S-insertchar] 'yank) +;; The next three keys are used on MS Windows and Android. +(define-key global-map [copy] 'kill-ring-save) +(define-key global-map [paste] 'yank) +(define-key global-map [cut] 'kill-region) (define-key global-map [undo] 'undo) (define-key global-map [redo] 'repeat-complex-command) (define-key global-map [again] 'repeat-complex-command) ; Sun keyboard diff --git a/src/androidterm.c b/src/androidterm.c index 2894a58e6b9..d8a8b4c2d71 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -5217,6 +5217,7 @@ NATIVE_NAME (performContextMenuAction) (JNIEnv *env, jobject object, case 0: /* android.R.id.selectAll */ case 1: /* android.R.id.startSelectingText */ case 2: /* android.R.id.stopSelectingText */ + default: /* These actions are not implemented. */ return; @@ -5231,9 +5232,6 @@ NATIVE_NAME (performContextMenuAction) (JNIEnv *env, jobject object, case 5: /* android.R.id.paste */ key = 279; break; - - default: - emacs_abort (); } event.xkey.type = ANDROID_KEY_PRESS; @@ -5241,7 +5239,7 @@ NATIVE_NAME (performContextMenuAction) (JNIEnv *env, jobject object, event.xkey.window = window; event.xkey.time = 0; event.xkey.state = 0; - event.xkey.keycode = 66; + event.xkey.keycode = key; event.xkey.unicode_char = 0; event.xkey.counter = ++edit_counter;