From f2d49a0bc7fff957bace0fed5a92acbd0caf36c6 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 10 Jun 2024 15:37:58 +0800 Subject: [PATCH] Minor revisions to Android key bindings * etc/PROBLEMS (Runtime problems specific to Android): Document inappropriate generation of F3 on certain systems. * lisp/bindings.el ([iconify-frame], [make-frame-visible]): Update references to long-obsolete ignore-event command. * lisp/term/android-win.el ([KEYCODE_NOTIFICATION], [\83]): Ignore these two nuisance keys by default. (cherry picked from commit b7b43931ee4263e81bdaf41da571b94e01d10eff) --- etc/PROBLEMS | 10 +++++++++- lisp/bindings.el | 5 ++--- lisp/term/android-win.el | 10 ++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index 085ed4d0532..6c143d22de4 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -3666,7 +3666,7 @@ result that the next redisplay recenters the window around this outdated position. There is no solution but installing a more cooperative--and preferably free--input method. -** The default input method sometimes performs edits out of place in large buffers. +** The default input method performs edits elsewhere than point in large buffers. When first reactivated in a window after having been dismissed, certain heuristics applied by the "Android Keyboard (AOSP)" input method to @@ -3680,6 +3680,14 @@ in the input method that can be easily reproduced by inserting lengthy documents into any text editor, with no real solution except avoiding edit suggestions from recently-reactivated input methods. +** The F3 key appears to be spontaneously activated. + +It is possible that this is a product of your inadvertently contacting +the back-facing fingerprint sensor, which generates F3 key events on +devices manufactured by OnePlus and possibly others. Sadly, to the best +of our knowledge such events cannot be distinguished from legitimate +keypresses. + * Build-time problems ** Configuration diff --git a/lisp/bindings.el b/lisp/bindings.el index 59fcbf3fd0a..1baa5594be4 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -927,9 +927,8 @@ language you are using." ;; It seems that they can't because they're handled via ;; special-event-map which is used at very low-level. -stef (global-set-key [delete-frame] 'handle-delete-frame) -(global-set-key [iconify-frame] 'ignore-event) -(global-set-key [make-frame-visible] 'ignore-event) - +(global-set-key [iconify-frame] 'ignore) +(global-set-key [make-frame-visible] 'ignore) ;These commands are defined in editfns.c ;but they are not assigned to keys there. diff --git a/lisp/term/android-win.el b/lisp/term/android-win.el index bab6b6b9ff0..3e0f71abf91 100644 --- a/lisp/term/android-win.el +++ b/lisp/term/android-win.el @@ -617,6 +617,16 @@ accessible to other programs." :ccl-decoder 'android-decode-jni :ccl-encoder 'android-encode-jni) + +;; Default key definitions. + +;; Suppress KEYCODE_NOTIFICATION, which has been observed to be +;; spontaneously generated on certain tablets, so that the user may not +;; be disturbed by intrusive messages when it is registered. +(global-set-key [KEYCODE_NOTIFICATION] #'ignore) +(global-set-key [\83] #'ignore) ; KEYCODE_NOTIFICATION on pre-Honeycomb + ; releases. + (provide 'android-win) ;; android-win.el ends here. -- 2.39.2