godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.89k stars 20.16k forks source link

LineEdit on Android doesn't work #35753

Closed antocorr closed 4 years ago

antocorr commented 4 years ago

Which demo project is affected:

Multiplayer Bomber

OS/device including version:

Mac OSX Mojave 10.14.6 (18G103)

Issue description:

By tapping on a LineEdit the virtual keyboard pops up but it doesn't work if you type/delete something

I also tried to create a new scene with a Control node and a LineEdit.

BTW It works building from 3.1.2

Schweini07 commented 4 years ago

I tried it out and it too doesn't work (Arch Linux and a Huawei P Smart)

FeralBytes commented 4 years ago

Please confirm Godot version that you are having the issue on?

Schweini07 commented 4 years ago

The Godot version is 3.2

thrashmodule commented 4 years ago

I can also confirm LineEdit is not accepting input from Android's virtual keyboard. TextEdit does work.

Version 3.2

antocorr commented 4 years ago

3.1.2 works just fine

lawnjelly commented 4 years ago

I just had a look to check whether it could be a regression from #29948 (thinking maybe it could be classifying the line edit key input as from a game device (gamepad, joystick etc)). However looking at the code I don't think the PR change could cause this, it classifies more devices as keyboards, and doesn't add any more to the game devices. That doesn't mean there wasn't an existing problem with classification though.

For anyone who can debug the Android version, It is worth checking that any input is coming in at all to onKeyDown. It is also possible some changes to gestures or further up has prevented input getting to onKeyDown. That's assuming LineEdit uses normal input, I can also see a GodotTextInputWrapper. (Sorry I cannot work on this at the moment)

akien-mga commented 4 years ago

I anyone is up for testing older versions, it would be great to pinpoint the first alpha/beta or RC release where the regression happened: https://downloads.tuxfamily.org/godotengine/3.2/

Note that you need to install matching export templates to export to Android.

pouleyKetchoupp commented 4 years ago

Looking at LineEdit it looks like max_length could be responsible for it: https://github.com/godotengine/godot/blob/1361fa71c419a44c9a5849a599fa745efe9052cf/scene/gui/line_edit.cpp#L131

Default is 0, which means no limit according to the documentation. But maybe in the virtual keyboard implementation it actually means no input is accepted?

I'm going to run some tests to confirm.

dankan1890 commented 4 years ago

Related to #35438 ?

pouleyKetchoupp commented 4 years ago

It's confirmed, and yes it's due to the changes in PR #35438 (CC @MadEqua). The fix is very simple, so I'm going to propose a PR soon.

Workaround You can set Max Length property in your LineEdit to a large number instead of 0.

tinxx commented 4 years ago

Hi, thanks for your great work!

To apply this patch before it is actually released officially, do we have to build the export templates or the main engine we use to export the game?

Calinou commented 4 years ago

@tinxx Yes, in general, you have to recompile all the export templates you plan to use. However, since this fix only affects Android, you only have to recompile the Android export templates.

tinxx commented 4 years ago

@Calinou, thanks for the quick response! So just to be sure if it makes sense to set up the whole Android build system: Can we expect to get new official export templates prior to a new Godot engine version? And if so, will if be announced anywhere?

Calinou commented 4 years ago

Can we expect to get new official export templates prior to a new Godot engine version?

Outside of alphas/betas/release candidates, no. We don't have official daily builds yet, but you can use these builds provided by yours truly. These are provided on a best-effort basis, of course.