diff options
| author | Po Lu | 2023-08-30 10:07:49 +0800 |
|---|---|---|
| committer | Po Lu | 2023-08-30 10:07:49 +0800 |
| commit | 297ccd967f24e37bc51c057da43c862291a55ddd (patch) | |
| tree | 35c7bca464ae2fbf23c46176a698483937ddd51d /src | |
| parent | 2909ef8d3d73518525ce6a8a3e4f984575300f3b (diff) | |
| download | emacs-297ccd967f24e37bc51c057da43c862291a55ddd.tar.gz emacs-297ccd967f24e37bc51c057da43c862291a55ddd.zip | |
Facilitate typing `C-SPC' on Android
* doc/emacs/android.texi (Android Windowing): Mention C-SPC
interception and how it may be disabled.
* java/org/gnu/emacs/EmacsNative.java (shouldForwardCtrlSpace):
New function.
* java/org/gnu/emacs/EmacsView.java (onKeyPreIme): New function.
If the provided key code is SPC and the event's modifier key
mask contains ControlMask, relay it directly to onKeyDown.
* java/org/gnu/emacs/EmacsWindow.java (eventModifiers): Export
and make static.
* src/android.c (shouldForwardCtrlSpace): New function.
* src/androidfns.c (syms_of_androidfns)
<android_intercept_control_space>: New defvar.
Diffstat (limited to 'src')
| -rw-r--r-- | src/android.c | 6 | ||||
| -rw-r--r-- | src/androidfns.c | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/android.c b/src/android.c index ed304baf0e6..1ccb724247d 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -2267,6 +2267,12 @@ NATIVE_NAME (shouldForwardMultimediaButtons) (JNIEnv *env, | |||
| 2267 | return !android_pass_multimedia_buttons_to_system; | 2267 | return !android_pass_multimedia_buttons_to_system; |
| 2268 | } | 2268 | } |
| 2269 | 2269 | ||
| 2270 | JNIEXPORT jboolean JNICALL | ||
| 2271 | NATIVE_NAME (shouldForwardCtrlSpace) (JNIEnv *env, jobject object) | ||
| 2272 | { | ||
| 2273 | return !android_intercept_control_space; | ||
| 2274 | } | ||
| 2275 | |||
| 2270 | JNIEXPORT void JNICALL | 2276 | JNIEXPORT void JNICALL |
| 2271 | NATIVE_NAME (blitRect) (JNIEnv *env, jobject object, | 2277 | NATIVE_NAME (blitRect) (JNIEnv *env, jobject object, |
| 2272 | jobject src, jobject dest, | 2278 | jobject src, jobject dest, |
diff --git a/src/androidfns.c b/src/androidfns.c index 9e8372f524b..51421f0a68a 100644 --- a/src/androidfns.c +++ b/src/androidfns.c | |||
| @@ -3205,6 +3205,19 @@ Note that if you set this, you will no longer be able to quit Emacs | |||
| 3205 | using the volume down button. */); | 3205 | using the volume down button. */); |
| 3206 | android_pass_multimedia_buttons_to_system = false; | 3206 | android_pass_multimedia_buttons_to_system = false; |
| 3207 | 3207 | ||
| 3208 | DEFVAR_BOOL ("android-intercept-control-space", | ||
| 3209 | android_intercept_control_space, | ||
| 3210 | doc: /* Whether Emacs should intercept C-SPC. | ||
| 3211 | When this variable is set, Emacs intercepts C-SPC events as they are | ||
| 3212 | delivered to a frame before they are registered and filtered by the | ||
| 3213 | input method. | ||
| 3214 | |||
| 3215 | For no apparent purpose, Android input methods customarily discard SPC | ||
| 3216 | events with the Ctrl modifier set without delivering them to Emacs | ||
| 3217 | afterwards, which is an impediment to typing key sequences | ||
| 3218 | incorporating such keys. */); | ||
| 3219 | android_intercept_control_space = true; | ||
| 3220 | |||
| 3208 | DEFVAR_BOOL ("android-use-exec-loader", android_use_exec_loader, | 3221 | DEFVAR_BOOL ("android-use-exec-loader", android_use_exec_loader, |
| 3209 | doc: /* Whether or not to bypass system restrictions on program execution. | 3222 | doc: /* Whether or not to bypass system restrictions on program execution. |
| 3210 | 3223 | ||