How do I detect "Enter" on a textbox?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Use the condition On text changed or Compare text.

    Yes, Set position works with textboxs.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)