Wrap text with a custom keyboard

Hi! I have recently made a custom keybord because i the iOS didnt look the way i wanted. However i have problems with word wrapping, i have defined the hight and width of my text and it wraps perfect automaticly. But if i want to att a key on my keyboard that wraps when i want to like this:

text.text = text.text.. \n  

It dosent work, however if i write:

[code]
text.text = text.text… "foo \n bar "

[code]

it wraps but i dont want any extra text to be added, how do i solve this?
[import]uid: 134049 topic_id: 29515 reply_id: 329515[/import]

Hi,

I’m not certain I understand what you’re trying to do here, but I imagine you could just put the “\n” on its own.

[lua]text.text = text.text…"\n"[/lua]

If you can provide a bit more context then I’m sure someone can help.

Ali [import]uid: 10499 topic_id: 29515 reply_id: 118469[/import]

i tried that however that does nothing… odd enough…
it just leaves me with the text i had before without a wrap [import]uid: 134049 topic_id: 29515 reply_id: 118602[/import]

That’s expected behaviour. The “\n” should only put a new line on the end.

Unless you add some on later, you won’t see any difference.

What exactly are you trying to achieve here?

Ali [import]uid: 10499 topic_id: 29515 reply_id: 118604[/import]

what im trying to achive is that if i write this in my game “Hello my name is Anakta” and then press my enter button the next thing i write should appear under, like this:
“Hello my name is Anakta
And i code in corona”
but it dosent when i try to insert “\n”
*Alltho when i hardcode the string like

foo= display newText(g, "Hello My name is Anakta \n and i code in corona)

it works [import]uid: 134049 topic_id: 29515 reply_id: 118607[/import]

Hmm… that is odd.

If you print out the string, has the “\n” been removed from the string?

Ali [import]uid: 10499 topic_id: 29515 reply_id: 118609[/import]

if i do push my enter button and then run the code:

text.text = text.text.."\n"  

and after that do a print

print(text.text)  

id prints it without the \n. [import]uid: 134049 topic_id: 29515 reply_id: 118610[/import]