Advance to next character on textfield

Yo, here’s the thing: I have this input textfield, which is supposed to send info to a server through sockets and stuff.

The textfield sends the info when ENTER is pressed.

To do that I use an “on (keyPress “<Enter>”)” ‘event checker’ that completely disables the used of the Enter key for other means.

However I still need SHIFT + ENTER to make it possible to skip lines.

The solution I found was to check for whether SHIFT is pressed, and, when it is, instead of sending the socket data, adding a "
" character to the text field.

Problem is: when this is done the cursor-thing that indicates which part of the text you are editing (the thing that looks like a blinking version of this: | ) does not advance to the following character of the text, making it look like you’ve never skipped any line at all, when in fact you did.

Any way to fix this (maybe with the simulation of pressing the RIGHT key)?


EDIT: I figured it out, this is what I did:

on (keyPress “<Enter>”) {
//all that happens when SHIFT isn’t pressed
if (Key.isDown(Key.SHIFT)) {_root.inputMsg.text += "
“; Selection.setFocus(”_root.inputMsg"); Selection.setSelection(Selection.getEndIndex(),Selection.getEndIndex());}
}