emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/android a4bf3ad9586: Fix typos in Android port


From: Po Lu
Subject: feature/android a4bf3ad9586: Fix typos in Android port
Date: Sat, 3 Jun 2023 03:08:20 -0400 (EDT)

branch: feature/android
commit a4bf3ad95869771afb4b8c64d14fa145348e4d2b
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix typos in Android port
    
    * lisp/bindings.el (global-map): Bind cut, copy and paste.
    * src/androidterm.c (JNICALL): Use key.
---
 lisp/bindings.el  | 4 ++++
 src/androidterm.c | 6 ++----
 2 files changed, 6 insertions(+), 4 deletions(-)

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;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]