How do I detect "Enter" on a textbox?

Get help using Construct 2

Post » Thu Mar 19, 2015 6:52 am

On a PC, I can detect return key being pressed or whatever, but, on an Android or IOS device, will the virtual keyboard register that same "On Key Pressed" event? If not, how do I detect that the user is done entering text?

I'm going to use a button.... but I'd like to work the way I expect the user to expect it to work.

Also, is Set Position supposed to work with a textbox? I know it's a form control not an ingame object, but I can't seem to get it to move.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Thu Mar 19, 2015 11:20 am

Use the condition On text changed or Compare text.

Yes, Set position works with textboxs.
Image
B
15
S
6
Posts: 126
Reputation: 1,755

Post » Sat Mar 21, 2015 6:39 am

Ah, I was using System Wait actions before moving the Textbox, which seems to be what screwed it up, though I don't know why.

On the PC anyway, the On Text Changed works as I expect it to, and triggers whenever a character is entered or deleted. Thats fine, I was expecting to check for a newline, but the OnTextChanged does not trigger when I hit enter. I'm a little unclear on how things are supposed to work on a smartphone. I'm using OnKeyPressed for now untill I get a phone and test it.

Also, is there any way to detect whether a keyboard is attached at all? I figure I need to build a gamepad friendly text entry box if the keyboard is missing.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536


Return to How do I....?

Who is online

Users browsing this forum: iStudios and 2 guests