mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-08-18 14:32:16 +02:00
Compare commits
1 Commits
master
...
workaround
Author | SHA1 | Date | |
---|---|---|---|
|
50b986ef28 |
@@ -41,12 +41,7 @@ public final class KeyEventHandler
|
|||||||
public void started(EditorInfo info)
|
public void started(EditorInfo info)
|
||||||
{
|
{
|
||||||
_autocap.started(info, _recv.getCurrentInputConnection());
|
_autocap.started(info, _recv.getCurrentInputConnection());
|
||||||
// Workaround a bug in Acode, which answers to [getExtractedText] but do
|
_move_cursor_force_fallback = should_move_cursor_force_fallback(info);
|
||||||
// not react to [setSelection] while returning [true].
|
|
||||||
// Note: Using & to workaround a bug in Acode, which sets several
|
|
||||||
// variations at once.
|
|
||||||
_move_cursor_force_fallback = (info.inputType & InputType.TYPE_MASK_VARIATION &
|
|
||||||
InputType.TYPE_TEXT_VARIATION_PASSWORD) != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Selection has been updated. */
|
/** Selection has been updated. */
|
||||||
@@ -473,6 +468,17 @@ public final class KeyEventHandler
|
|||||||
return (conn.getSelectedText(0) != null);
|
return (conn.getSelectedText(0) != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Workaround some apps which answers to [getExtractedText] but do not react
|
||||||
|
to [setSelection] while returning [true]. */
|
||||||
|
boolean should_move_cursor_force_fallback(EditorInfo info)
|
||||||
|
{
|
||||||
|
// This catch Acode: which sets several variations at once.
|
||||||
|
if ((info.inputType & InputType.TYPE_MASK_VARIATION & InputType.TYPE_TEXT_VARIATION_PASSWORD) != 0)
|
||||||
|
return true;
|
||||||
|
// Godot editor: Doesn't handle setSelection() but returns true.
|
||||||
|
return info.packageName.startsWith("org.godotengine.editor");
|
||||||
|
}
|
||||||
|
|
||||||
public static interface IReceiver
|
public static interface IReceiver
|
||||||
{
|
{
|
||||||
public void handle_event_key(KeyValue.Event ev);
|
public void handle_event_key(KeyValue.Event ev);
|
||||||
|
Reference in New Issue
Block a user