'Carriage Return' Character appearing when I press enter in a textbox

I am not sure if this is a Roblox bug, but I can’t post in the bugs section anyway.

For some reason, whenever I press enter in a textbox it adds a character known as a ‘Carriage Return’ which is really annoying when I am trying to split up text. At the moment in my script, as soon as the user presses enter the textbox captures focus again so they can continue to type into the box.

I dont need a fix for how to get around this, I just want to know if anybody knows why it is happening.

1 Like

I’m not sure why this could be - try uninstalling then reinstalling roblox studio.

I gave it a go, unfortunately it is still happening.

It could be a hardware issue then, try updating all of your devices.

Its probably a computer bug not a roblox bug because that does’nt happen for me

Wait have you tried with this:

Recreation_Test.rbxl (31.4 KB)

It is a recreation of the textbox I am using (basically just has ClearTextOnFocus off)

If you test it and it prints the number 2 or higher that means it is doing what it is doing for me.

Hmm weird it printed 1 then 2(x3) then 1

Yeah so 2 means it is detecting the Carriage Return character. I think it is something to do with me capturing the textbox’s focus as soon as they press enter.

i have no idea I thought i did it once but it broke idk sorry

This is not a Roblox bug!

CR: carriage return (\r), LF: line feed (\n)

In the long long ago, DOS, Windows’ predecessor, had to interface with teletypewriters.
“CR” would send the typewriter back to the beginning, and “LF” would send it down a line.

Microsoft is obsessed with backwards compatibility, so they’ve still stuck with CRLF until today.

Unix (and Linux) always just used LF because they existed after teletypewriters were relevant.
Edit: No, that’s not the reason. See this Wikipedia article.

Mac OS used CR until Mac OS X, in which they switched to LF.

1 Like