Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android Godot Editor] Script editor in android sometimes adds random characters repeatedly #70751

Open
Nogardagem opened this issue Dec 30, 2022 · 11 comments

Comments

@Nogardagem
Copy link

Nogardagem commented Dec 30, 2022

Godot version

3.5.1

System information

Galaxy Tab S8, Android 13

Issue description

I'm using a bluetooth keyboard with my tablet to code in godot more easily on-the-go.
After typing for a while, each time using the editor, without fail, the script editor will start to add random characters or replace others.

Ex: Goes from

var dict {
    key: val
}

to

var dict {
    key: val
    }
    }
}

all occuring without input, and repeating after disconnecting the keyboard. It will also format things weirdly occasionally, ex: start

    b();
func b():
    nothing();

goes to

    b();
    func b();
        nothing();

Steps to reproduce

To reproduce, I'm not sure what exactly would be needed.
At a minimum, be using an android device with a bluetooth keyboard, and type some long scripts. After writing about 3 or 4 functions in a single file it seems to happen. Different indentation should be used for the indentation problem, and dictionaries show the adding-random-characters thing well.
The first project that I made had this error, implementing Conway's Game of Life, which would probably be a good script for making to test with.

Minimal reproduction project

Make a new project and start writing a script as if it's just a script, with multiple functions, different indentation, and different variable types (array, dictionary, etc).
I don't think the project in specific affects it here, this has happened with every project I've made in the android version of godot so far (4 projects total).

@Nogardagem
Copy link
Author

oh wow the formatting really messed up my examples, the first one made new curly brackets on new lines, sometimes indented, sometimes not, and it changed "extends" to "exextends" or "exxexextends" or something

the second issue would add indentation, effectively ignoring decreases in the amount of indentation, just adding, as if you had selected everything before pressing 'tab' at all

@YuriSizov
Copy link
Contributor

@Nogardagem You can edit your post. You've used one backtick, that's fine for inline code, but multiline code blocks must be wrapped with 3 backticks on each side.

@Nogardagem
Copy link
Author

I somehow managed to fix it by changing some random editor formatting settings a couple times, but I have no reliable way to fix it. Also, I realized having the pen from my tablet active at the same time as the keyboard when starting the project will cause it to crash godot, but that's not too horrible and can be worked around easily by not using the pen.

@DairGortas
Copy link

DairGortas commented Feb 15, 2023

Having a similar issue, can't type at all without it undoing my work, indenting everything, and extending extends
eextenextends node2D

Edit: was using Bluetooth keyboard but it happens even with digital keyboard

@HapticGG
Copy link

same issue here using the tab s7 its rendering it completly unusable. Issue persists between Version 3 and 4 and both AP/ google play store. Issue also remained after a factory reset.

I have tried with/without usb Keyboard With/Without S-Pen with a bluetooth keyboard, on screen keyboard, and a wired keyboard, I have also tried inside and outside of dex. (im on a tab s7)

I have changed text editor settings but nothing i do seems to fix the issue. as soon as I try to edit a script it bugs out and is completly unusable due to repeated indents/inserting stuff i didnt place. (editor works fine on my pixel 7)

@m4gr3d m4gr3d self-assigned this May 30, 2023
@m4gr3d
Copy link
Contributor

m4gr3d commented May 30, 2023

I have confirmed and reproduced the issue. Currently working on a fix for the next update of the Android editor.

@YuriSizov
Copy link
Contributor

Commenting for clarity: according to the linked PRs this is now fixed for hardware keyboard, but not software keyboard.

@YuriSizov YuriSizov modified the milestones: 4.2, 4.x Nov 14, 2023
@wonjaegang
Copy link

still having a hard time with software keyboard....

@wonjaegang
Copy link

and I found something really interesting here.
SmartSelect_20231221_080615_Godot Editor 4

the code above can be typed well with my software keyboard.
but, if I change my variable name, which is 'aa' right now, into 'isPressing',
the editor starts to indent everywhere and type some weird word(ex. exexexexexextend).

@m4gr3d
Copy link
Contributor

m4gr3d commented Dec 21, 2023

@wonjaegang We rolled out a fix for the hardware keyboard, but the fix for the software keyboard is still under investigation as it affects a large portion of the Godot Android input logic.
Nonetheless, I expect to have a fix ready in time for Godot 4.3.

In the meantime, using an external (e.g: bluetooth) keyboard would be the recommended approach to avoid this issue.

@zvsmith
Copy link

zvsmith commented Jan 6, 2024

Just in case this helps with the fix, or helps anybody still having software keyboard issues until the fix is rolled out: For me (on a Samsung A52s, Android 13), the problem seems to have been the Samsung keyboard's predictive text feature.

If I disable predictive text, or switch to GBoard, the issue seems to go away entirely. As a bonus, it also fixed another annoying text entry problem I had with another app where the cursor would constantly jump to the bottom of files.

m4gr3d added a commit to m4gr3d/godot that referenced this issue Jul 8, 2024
Implements a Godot specific `InputConnection` interface which allows the engine to control its interaction with Android virtual keyboards.

Fixes godotengine#70751
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants