Go to next textbox when "Enter" is pressed

textbox
aia

#1

Hi Thunkers!,

I decided to make this tutorial because of @dddiam’s topic HERE.

I haven’t seen anyone from App Inventor manage this before, which is why I’m posting this.


Step 1
Insert your textboxes

Step 2
Set ‘MultiLine’ to true

Step 3
Insert a Clock component.

Step 4
Set the following properties for the clock

Step 5
The blocks:

Instead of going to the next TextBox you could also replace ‘Call TextBox.RequestFocus’ to your own procedure.


Downloads
AIA File: KeyboardTest.aia (2.1 KB)

APK File: KeyboardTest.apk (2.1 MB)



How do I trigger an event when the user is done typing?
Get input from textbox?
How can I limit the numbers of characters the user types on a text box?
How to hide app buttons while keyboard is in use?
Landscape keyboard mode
How to get position of the mouse in textbox
How can I prevent text fields to automatically get focus in APK?
Auto-generate labels based on input
#2

WOW, it’s very useful

I never realised that this could be possible


#3

Great!!! Very useful!


#4

Thanks. I am going to use this


#5

Thank you, Conor. What a clever implementation of a textchanged event!

Is there a CPU hit for having a timer constantly running? How are timers implemented internally?

David


#6

No, because Thunkable doesn’t support running the app after closing it. For this you must use http://services.appinventor.mit.edu/

Checkout this file: TimerInternal.java
It’s the file that makes the Timer work


#7

Thanks…but that does not work when I check NumbersOnly property.
Are you know any posible solution?

Thanks


#8

Yes that’s right. This is because the \n character isn’t a number and so cannot be inserted when the enter button is pressed.

I’ve think I’ve got a solution and will let you know shortly.


#9

I’ve got a solution!

Could you test this and see if it works for you?
KeyboardTestNumbersOnly.aia (20.9 KB)


#10

Hi, That work fine, but I need use the Numeric Keyboard for my app, and for this solution is necessary use the normal Keyboard.

Sorry for my English :wink:


#11

I don’t think that the showing the numeric keyboard using this solution is possible.


#12

Here is a more direct approach:


Use the AddEnterPressListener method.

Cheers!
Helios


#13

A post was merged into an existing topic: Way to jump from one textbox to another?


#14

That was awesome Colin. Worked perfectly for my login system. thank you