mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-06-22 10:42:43 +02:00
Fix Enter key sending message in Discord
Set the flag FLAG_SOFT_KEYBOARD when sending key events stops Discord from sending message when typing Enter. The other values are the same that are sent when using sendDownUpKeyEvents().
This commit is contained in:
parent
188c68279d
commit
e1191f3add
@ -3,6 +3,7 @@ package juloo.keyboard2;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
|
import android.view.KeyCharacterMap;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.view.inputmethod.ExtractedText;
|
import android.view.inputmethod.ExtractedText;
|
||||||
@ -196,7 +197,9 @@ public final class KeyEventHandler
|
|||||||
InputConnection conn = _recv.getCurrentInputConnection();
|
InputConnection conn = _recv.getCurrentInputConnection();
|
||||||
if (conn == null)
|
if (conn == null)
|
||||||
return;
|
return;
|
||||||
conn.sendKeyEvent(new KeyEvent(1, 1, eventAction, eventCode, 0, _meta_state));
|
conn.sendKeyEvent(new KeyEvent(1, 1, eventAction, eventCode, 0,
|
||||||
|
_meta_state, KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
|
||||||
|
KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE));
|
||||||
if (eventAction == KeyEvent.ACTION_UP)
|
if (eventAction == KeyEvent.ACTION_UP)
|
||||||
_autocap.event_sent(eventCode, _meta_state);
|
_autocap.event_sent(eventCode, _meta_state);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user