godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Mobile: Add ability to change Keyboard imeOptions/InputType #2504

Open leakim34 opened 3 years ago

leakim34 commented 3 years ago

Describe the project you are working on

I'm working on 2D game for mobiles (IOS/Android). Texts based gameplay where player has to type words to match with partner.

Describe the problem or limitation you are having in your project

No ability to setup device's keyboard in order to match the requested data. eg: Email, phone number,... Sometimes It would be usefull to be able to switch to next focus or trigger an action depending which action button is set on the keyboard.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

It will help us to adapt keyboard to situations depending on what we want from the input device (email/phone/...) and how it behaves (eg: action button : send/next/done/...)

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Add the ability to interact with the GodotEditText module. Suggestion would be to make this property public or add a getter for it (a setter is already present).

https://github.com/godotengine/godot/blob/9343a8a9705cc43100f3e14af895f0842895a7a5/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java#L60

If this enhancement will not be used often, can it be worked around with a few lines of script?

With my suggestion above it would allow us to write our android plugin and adjust the way the EditText is working.

Is there a reason why this should be core and not an add-on in the asset library?

Yes, because we have no way to get this EditText instance.

Thanks

mehdiym commented 3 years ago

Hello, I highly support this request. Having access to the EditText instance would allow many mobile projects to adapt the virtual keyboard to the situation, depending on the user's action (validating, submitting, adding...), content (text, mail address, numbers...) and features (suggestions...)