Hey guys,
I want my players to be able to use an Edit Box Dialog Item to chat, however, I stumbled upon the issue that there is no event that is triggered when a player presses the Enter key while having an Edit Box highlighted.
When using the "UI - Player Any Player presses Enter key Down with shift Allow, control Allow, alt Allow" event, it doesn't trigger.
When using the "Dialog - Any Dialog Item is used by Player Any Player with event type Changed Text" event, it doesn't trigger.
Is there any way of getting the Enter key while the player has an Edit Box highlighted?
For now I'll use a button to get my players to send the chat, but I'd rather have it trigger on the Enter key.
Seems you can't check something like "Edit box.focused" but you can check is given dialog window/item visible/enabled. you can than alter this item state when players starts to type.
you could do something like 'event enter pressed' 'IF (dialog/dialogitem visible for triggering player) THEN ('pass editbox.value somewhere', hide dialog/dialogitem) ELSE (show dialog/dialogitem, change editbox.value to "")'
@Nerfpl:
When I talk about the events, I'm talking about just the events when I press the Enter button. No conditions.
Aka, if I press the enter button, the trigger doesn't run its actions.
What I want is an event that makes the trigger run its actions if I press the Enter button while the edit box is highlighted. Doesn't matter if that event makes the trigger run on other buttons too, I'll be able to filter those out, but I can't find anything that makes it run when the Enter button is pressed.
So, in example, if I have:
Event - Enter button is pressed
Action - Text message: Boo!
and ingame, I select the edit box and press the Enter button, nothing happens.
or
If I have:
Event - Edit value of edit box changes
Action - Text message: Boo!
and ingame, I select the edit box and press the Enter button, nothing happens. If I type "omg" in the edit box and then press the enter button, Boo! will appear three times.
@Lillu70:
Untrue. If that were true, I'd be able to check for it through the
Dialog - Dialog Item is used by Player Any Player with event type Changed Value
event, and put a condition in there that asks for the enter key. However, when doing that without the condition and having a message appear every time something is entered into the edit box, the enter key does not function.
@qwertziopuy:
Yea I did that as a temporary solution.
Why don't you try having the message automatically save as it's typed out? Then they don't even have to press enter. Kind of like the old chatrooms back in the 90's. I assume you have the edit box and labels above it containing the text. Just assign a label to a player when he starts typing. When there's a long enough delay in typing (signifying the message is done), or the player uses a period or something, assign another one and allow the previous label to move up as an old message.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Seems you can't check something like "Edit box.focused" but you can check is given dialog window/item visible/enabled. you can than alter this item state when players starts to type.
you could do something like 'event enter pressed' 'IF (dialog/dialogitem visible for triggering player) THEN ('pass editbox.value somewhere', hide dialog/dialogitem) ELSE (show dialog/dialogitem, change editbox.value to "")'
ah so your saying when in edit box, enter press is not detected, well that's may be unavoidable then
You cant trigger it with key event because it just writes that key in the edit box and Enter happends to be a key.
You can create a "send" button near the edit box. Might be a soultion.
@Eldrazor: Go
Why don't you try having the message automatically save as it's typed out? Then they don't even have to press enter. Kind of like the old chatrooms back in the 90's. I assume you have the edit box and labels above it containing the text. Just assign a label to a player when he starts typing. When there's a long enough delay in typing (signifying the message is done), or the player uses a period or something, assign another one and allow the previous label to move up as an old message.