mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-08 23:40:24 -08:00
Provide for Num Lock and Scroll Lock on Android
* java/org/gnu/emacs/EmacsWindow.java (onKeyDown, onKeyUp): Retain META_NUM_LOCK_ON and META_SCROLL_LOCK_ON while filtering meta state.
This commit is contained in:
parent
4072e06a5f
commit
a2c2ec548b
1 changed files with 24 additions and 4 deletions
|
|
@ -644,7 +644,7 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
public void
|
||||
onKeyDown (int keyCode, KeyEvent event)
|
||||
{
|
||||
int state, state_1;
|
||||
int state, state_1, num_lock_flag;
|
||||
long serial;
|
||||
String characters;
|
||||
|
||||
|
|
@ -665,13 +665,23 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
|
||||
state = eventModifiers (event);
|
||||
|
||||
/* Num Lock and Scroll Lock aren't supported by systems older than
|
||||
Android 3.0. */
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
||||
num_lock_flag = (KeyEvent.META_NUM_LOCK_ON
|
||||
| KeyEvent.META_SCROLL_LOCK_ON);
|
||||
else
|
||||
num_lock_flag = 0;
|
||||
|
||||
/* Ignore meta-state understood by Emacs for now, or key presses
|
||||
such as Ctrl+C and Meta+C will not be recognized as an ASCII
|
||||
key press event. */
|
||||
|
||||
state_1
|
||||
= state & ~(KeyEvent.META_ALT_MASK | KeyEvent.META_CTRL_MASK
|
||||
| KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK);
|
||||
| KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK
|
||||
| num_lock_flag);
|
||||
|
||||
synchronized (eventStrings)
|
||||
{
|
||||
|
|
@ -692,19 +702,29 @@ public final class EmacsWindow extends EmacsHandleObject
|
|||
public void
|
||||
onKeyUp (int keyCode, KeyEvent event)
|
||||
{
|
||||
int state, state_1, unicode_char;
|
||||
int state, state_1, unicode_char, num_lock_flag;
|
||||
long time;
|
||||
|
||||
/* Compute the event's modifier mask. */
|
||||
state = eventModifiers (event);
|
||||
|
||||
/* Num Lock and Scroll Lock aren't supported by systems older than
|
||||
Android 3.0. */
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
|
||||
num_lock_flag = (KeyEvent.META_NUM_LOCK_ON
|
||||
| KeyEvent.META_SCROLL_LOCK_ON);
|
||||
else
|
||||
num_lock_flag = 0;
|
||||
|
||||
/* Ignore meta-state understood by Emacs for now, or key presses
|
||||
such as Ctrl+C and Meta+C will not be recognized as an ASCII
|
||||
key press event. */
|
||||
|
||||
state_1
|
||||
= state & ~(KeyEvent.META_ALT_MASK | KeyEvent.META_CTRL_MASK
|
||||
| KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK);
|
||||
| KeyEvent.META_SYM_ON | KeyEvent.META_META_MASK
|
||||
| num_lock_flag);
|
||||
|
||||
unicode_char = getEventUnicodeChar (event, state_1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue