Hiding the suggestion bar for virtual keyboards

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By joshsegall

I just upgraded from 3.2 to 3.3 and noticed my iOS export now adds a suggestion bar to the virtual keyboard when using a LineEdit control. In addition to changing the keyboard height and messing with my layout, it also takes half the fun out of my word guessing game. I don’t see any option to control or turn this off. This is also a problem for the Android export (though 3.2 shows the suggestions).

I’d settle for editing the code myself and adding whatever flags are needed to customize the keyboard for my app, but the options seem buried in the export templates. I don’t know where to start to dig up the code for those since they are downloaded and built separately.

So I did find the instructions for compiling iOS and Android:
Compiling for iOS — Godot Engine (3.3) documentation in English
Compiling for Android — Godot Engine (3.3) documentation in English

I’m going to try to go that route, but would still appreciate (a) any specific pointers to the keyboard code that I should change, and (B) some way to make this a first-class option via gdscript or the editor.

joshsegall | 2021-04-28 05:03

:bust_in_silhouette: Reply From: joshsegall

Here’s how I solved this problem for myself. It involves editing the godot source, so it’s not ideal, but it worked for me.

Basically, follow the Godot instructions for compiling for iOS/Android (Compiling for iOS — Godot Engine (stable) documentation in English, Compiling for Android — Godot Engine (stable) documentation in English), and edit the following lines:

For iOS, add this below the line:

self.autocorrectionType = UITextAutocorrectionTypeNo;

For Android, change this line:

int inputType = InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;

You will have to do a custom build for Android as explained in the export documentation (https://docs.godotengine.org/en/stable/getting_started/workflow/export/android_custom_build.html). Note that after you will have to reinstall the Android Build Template for any project that you’ve already configured for a custom build.