Fix Android's builtin shortcut not working

The 'repeat' field of generated key events was incorrectly set to '1'.
This commit is contained in:
Jules Aguillon 2021-12-11 01:03:36 +01:00
parent cca832954e
commit 58e37b484c

View File

@ -265,7 +265,7 @@ public class Keyboard2 extends InputMethodService
metaState |= KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_ON;
if ((flags & KeyValue.FLAG_SHIFT) != 0)
metaState |= KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_ON;
event = new KeyEvent(1, 1, KeyEvent.ACTION_DOWN, key.eventCode, 1, metaState);
event = new KeyEvent(1, 1, KeyEvent.ACTION_DOWN, key.eventCode, 0, metaState);
getCurrentInputConnection().sendKeyEvent(event);
getCurrentInputConnection().sendKeyEvent(KeyEvent.changeAction(event, KeyEvent.ACTION_UP));
}