LineEdits in my project are typing from right to left. How do I make them type from left to right?

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

I am not sure how this happened.

But when I type in my LineEdit control nodes, it types as though I was typing Arabic.

So typing 1 2 3 in that order will show (in order) in the LineEdit:


I cannot find a setting to reverse this. Where would that be?

(I have tried deleting offending nodes and re-instantiating them, but…the problem persists.)

I assume the characters are not also upside down or backwards, right? If they are, that could indicate a negative scale value…

jgodfrey | 2022-02-22 21:39

No, none of that.
Everything is upright.
A just-spawned LineEdit node is doing it, so I figure there’s a setting somewhere I don’t know about and I accidentally hit my keyboard in juuuust the right way to toggle this weird setting.

jerryjrowe | 2022-02-22 21:41

Last I knew, Godot didn’t support RTL input, so this seems very strange indeed. Was the control added via the editor or via code (shouldn’t matter, just looking for data points).

I’m curious, if you start up an empty, scratch project and add a LineEdit control to the default scene, do you see the same issue?

jgodfrey | 2022-02-22 21:46

I added the node via the editor.

And I think I tracked down what was happening…

I had a tiny line of code that was making sure that any time the text in the LineEdit $Value was changed, it would convert the text to an int of itself. (Because I had a drag-and-drop thing going on, and it was passing in floats.)

This was the line:

$Value.text = str(int($Value.text))

I think what was happening was that when that line ran (on every text change), it was deleting everything on that line, and then putting it back in…behind the caret.
So…I think the problem is solved. I knew it would be something embarrassingly silly. Thanks for your help!

jerryjrowe | 2022-02-22 22:00

Nice - glad you found the problem.

jgodfrey | 2022-02-22 22:02

Although now that I think about it…
Hey I figured out a way to easily have RTL input for a lineedit! XD

jerryjrowe | 2022-02-22 22:02

Thanks a ton for this. I’m trying to add Arabic support for my program and I needed a way to reverse LineEdit input. No joke, doing a simple text = text in a method responding to the text_changed() signal accomplishes this.

I’m not even sure how it works, but it does.

blurrred | 2022-06-08 20:33