diff options
| author | Po Lu | 2024-04-27 10:47:12 +0800 |
|---|---|---|
| committer | Po Lu | 2024-04-27 10:47:12 +0800 |
| commit | db8f7ed7f652c114e606de423e5094b4cefe49e2 (patch) | |
| tree | 2ba2fd002786db7599f9efac0c8965b13f0c54e2 /src | |
| parent | 763eaa5a324ff51dddad32d725ec8d416597d6d5 (diff) | |
| download | emacs-db8f7ed7f652c114e606de423e5094b4cefe49e2.tar.gz emacs-db8f7ed7f652c114e606de423e5094b4cefe49e2.zip | |
Enable customization of the quit key on Android
* doc/emacs/android.texi (Android Windowing):
* doc/emacs/input.texi (On-Screen Keyboards): Document various
tidbits related to the quit key.
* java/org/gnu/emacs/EmacsNative.java (getQuitKeycode): New
function.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): Rename
`lastVolumeButtonRelease' to `lastQuitKeyRelease'.
(onKeyUp): Treat value returned by getQuitKeycode as the quit
key rather than mandate KEYCODE_VOLUME_DOWN.
* src/android.c (getQuitKeycode): Implement new function.
* src/androidterm.c (syms_of_androidterm)
<android_quit_keycode>: New variable.
Diffstat (limited to 'src')
| -rw-r--r-- | src/android.c | 7 | ||||
| -rw-r--r-- | src/androidterm.c | 16 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/android.c b/src/android.c index e44b58c5973..00a77fc398d 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -2645,6 +2645,13 @@ NATIVE_NAME (shouldForwardMultimediaButtons) (JNIEnv *env, | |||
| 2645 | return !android_pass_multimedia_buttons_to_system; | 2645 | return !android_pass_multimedia_buttons_to_system; |
| 2646 | } | 2646 | } |
| 2647 | 2647 | ||
| 2648 | JNIEXPORT jint JNICALL | ||
| 2649 | NATIVE_NAME (getQuitKeycode) (JNIEnv *env, jobject object) | ||
| 2650 | { | ||
| 2651 | /* Likewise. */ | ||
| 2652 | return (jint) android_quit_keycode; | ||
| 2653 | } | ||
| 2654 | |||
| 2648 | JNIEXPORT jboolean JNICALL | 2655 | JNIEXPORT jboolean JNICALL |
| 2649 | NATIVE_NAME (shouldForwardCtrlSpace) (JNIEnv *env, jobject object) | 2656 | NATIVE_NAME (shouldForwardCtrlSpace) (JNIEnv *env, jobject object) |
| 2650 | { | 2657 | { |
diff --git a/src/androidterm.c b/src/androidterm.c index e4f3abdb2d3..5de7b6f4e14 100644 --- a/src/androidterm.c +++ b/src/androidterm.c | |||
| @@ -6703,6 +6703,22 @@ so it is important to limit the wait. | |||
| 6703 | If set to a non-float value, there will be no wait at all. */); | 6703 | If set to a non-float value, there will be no wait at all. */); |
| 6704 | Vandroid_wait_for_event_timeout = make_float (0.1); | 6704 | Vandroid_wait_for_event_timeout = make_float (0.1); |
| 6705 | 6705 | ||
| 6706 | DEFVAR_INT ("android-quit-keycode", android_quit_keycode, | ||
| 6707 | doc: /* Keycode that signals quit when typed twice in rapid succession. | ||
| 6708 | |||
| 6709 | This is the key code of a key whose repeated activation should prompt | ||
| 6710 | Emacs to quit, enabling quitting on systems where a keyboard capable of | ||
| 6711 | typing C-g is unavailable, when set to a key that does exist on the | ||
| 6712 | device. Its value must be a keycode defined by the operating system, | ||
| 6713 | and defaults to 25 (KEYCODE_VOLUME_DOWN), though one of the following | ||
| 6714 | values might be desired on those devices where this default is also | ||
| 6715 | unavailable, or if another key must otherwise serve this function | ||
| 6716 | instead: | ||
| 6717 | |||
| 6718 | - 4 (KEYCODE_BACK) | ||
| 6719 | - 24 (KEYCODE_VOLUME_UP) */); | ||
| 6720 | android_quit_keycode = 25; | ||
| 6721 | |||
| 6706 | DEFVAR_BOOL ("x-use-underline-position-properties", | 6722 | DEFVAR_BOOL ("x-use-underline-position-properties", |
| 6707 | x_use_underline_position_properties, | 6723 | x_use_underline_position_properties, |
| 6708 | doc: /* SKIP: real doc in xterm.c. */); | 6724 | doc: /* SKIP: real doc in xterm.c. */); |