mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-07 04:10:27 -08:00
Update Android port
* doc/emacs/android.texi (Android Windowing): Document how to pass multimedia keys to the system. * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New function. * java/org/gnu/emacs/EmacsView.java (onKeyDown, onKeyMultiple) (onKeyUp): Check that function. * java/org/gnu/emacs/EmacsWindow.java (defineCursor): Handle cases where cursor is NULL. * src/android.c (NATIVE_NAME): New function. * src/androidfns.c (syms_of_androidfns): New variable. * src/keyboard.c (lispy_function_keys): Add volume keys.
This commit is contained in:
parent
98d43dbef5
commit
1eb546309b
7 changed files with 61 additions and 1 deletions
|
|
@ -174,6 +174,10 @@ public final class EmacsNative
|
|||
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 ();
|
||||
|
||||
|
||||
|
||||
/* Input connection functions. These mostly correspond to their
|
||||
|
|
|
|||
|
|
@ -361,6 +361,12 @@ public final class EmacsView extends ViewGroup
|
|||
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;
|
||||
}
|
||||
|
|
@ -369,6 +375,12 @@ public final class EmacsView extends ViewGroup
|
|||
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;
|
||||
}
|
||||
|
|
@ -377,6 +389,12 @@ public final class EmacsView extends ViewGroup
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1234,7 +1234,10 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
public void
|
||||
run ()
|
||||
{
|
||||
view.setPointerIcon (cursor.icon);
|
||||
if (cursor != null)
|
||||
view.setPointerIcon (cursor.icon);
|
||||
else
|
||||
view.setPointerIcon (null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue