no way to transfer the contents of the primary selection to another
application via cut-and-paste.
+@vindex android-pass-multimedia-buttons-to-system
+@cindex volume/multimedia buttons, Android
+ The volume keys are normally reserved by Emacs and used to provide
+the ability to quit Emacs without a physical keyboard
+(@pxref{On-Screen-Keyboards}.) However, if you want them to adjust
+the volume instead, you can set the variable
+@code{android-pass-multimedia-buttons-to-system} to a non-@code{nil}
+value; note that you will no longer be able to quit Emacs using the
+volume buttons in that case.
+
@node Android Fonts
@section Font backends and selection under Android
@cindex fonts, android
main thread's looper to respond. */
public static native void endSynchronous ();
+ /* Return whether or not KEYCODE_VOLUME_DOWN, KEYCODE_VOLUME_UP and
+ KEYCODE_VOLUME_MUTE should be forwarded to Emacs. */
+ public static native boolean shouldForwardMultimediaButtons ();
+
\f
/* Input connection functions. These mostly correspond to their
public boolean
onKeyDown (int keyCode, KeyEvent event)
{
+ if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP
+ || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN
+ || keyCode == KeyEvent.KEYCODE_VOLUME_MUTE)
+ && !EmacsNative.shouldForwardMultimediaButtons ())
+ return false;
+
window.onKeyDown (keyCode, event);
return true;
}
public boolean
onKeyMultiple (int keyCode, int repeatCount, KeyEvent event)
{
+ if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP
+ || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN
+ || keyCode == KeyEvent.KEYCODE_VOLUME_MUTE)
+ && !EmacsNative.shouldForwardMultimediaButtons ())
+ return false;
+
window.onKeyDown (keyCode, event);
return true;
}
public boolean
onKeyUp (int keyCode, KeyEvent event)
{
+ if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP
+ || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN
+ || keyCode == KeyEvent.KEYCODE_VOLUME_MUTE)
+ && !EmacsNative.shouldForwardMultimediaButtons ())
+ return false;
+
window.onKeyUp (keyCode, event);
return true;
}
public void
run ()
{
- view.setPointerIcon (cursor.icon);
+ if (cursor != null)
+ view.setPointerIcon (cursor.icon);
+ else
+ view.setPointerIcon (null);
}
});
}
return event_serial;
}
+JNIEXPORT jboolean JNICALL
+NATIVE_NAME (shouldForwardMultimediaButtons) (JNIEnv *env,
+ jobject object)
+{
+ /* Yes, android_pass_multimedia_buttons_to_system is being
+ read from the UI thread. */
+ return !android_pass_multimedia_buttons_to_system;
+}
+
/* Forward declarations of deadlock prevention functions. */
static void android_begin_query (void);
doc: /* SKIP: real doc in xfns.c. */);
Vx_max_tooltip_size = Qnil;
+ DEFVAR_BOOL ("android-pass-multimedia-buttons-to-system",
+ android_pass_multimedia_buttons_to_system,
+ doc: /* Whether or not to pass volume control buttons to the system.
+Generally, the `volume-up', `volume-down' and `volume-mute' keys are
+processed by Emacs, but setting this to non-nil they are passed to the
+operating system instead of being intercepted by Emacs.
+
+Note that if you set this, you will no longer be able to quit Emacs
+using the volume down button. */);
+ android_pass_multimedia_buttons_to_system = false;
+
/* Functions defined. */
defsubr (&Sx_create_frame);
defsubr (&Sxw_color_defined_p);
[111] = "escape",
[112] = "delete",
[121] = "break",
+ [120] = "sysrq",
[122] = "home",
[123] = "end",
[124] = "insert",
[141] = "f11",
[142] = "f12",
[160] = "kp-ret",
+ [164] = "volume-mute",
[19] = "up",
[20] = "down",
[213] = "muhenkan",
[218] = "kana",
[21] = "left",
[22] = "right",
+ [24] = "volume-up",
+ [25] = "volume-down",
[259] = "help",
[268] = "kp-up-left",
[269] = "kp-down-left",
[66] = "return",
[67] = "backspace",
[82] = "menu",
+ [84] = "find",
[92] = "prior",
[93] = "next",
};