You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Fix text_entered signal when max_length is used in LineEdit on Android
Fixes #35954
This commit is contained in:
@@ -110,8 +110,13 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
GodotLib.key(0, 0, newChars[i], true);
|
int key = newChars[i];
|
||||||
GodotLib.key(0, 0, newChars[i], false);
|
if (key == '\n') {
|
||||||
|
// Return keys are handled through action events
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
GodotLib.key(0, 0, key, true);
|
||||||
|
GodotLib.key(0, 0, key, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -134,8 +139,13 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pActionID == EditorInfo.IME_ACTION_DONE) {
|
if (pActionID == EditorInfo.IME_NULL) {
|
||||||
|
// Enter key has been pressed
|
||||||
|
GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, true);
|
||||||
|
GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, false);
|
||||||
|
|
||||||
this.mView.requestFocus();
|
this.mView.requestFocus();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user