Textbox Tab event detection

I'm using a barcode scanner that is having a TAB as the suffix (it sends a tab after the string).

Does anyone know is there an extension that listens in the Textbox for a Tab?
Something like the Enter key in Taifuns Textbox extension. (https://puravidaapps.com/textbox.php)


1 Like

What is this? Please provide an example....

@TIMAI2 thanks for taking a look at this post.

I'm using a barcode scanner. When the textbox is having focus if the barcode scanner is paired with the tablet, when you scan a barcode it simply puts this text in the textbox.
Barcode scanners can be configured to add a so-called Terminator character after the scanned text.
For example, it can send the "CR+LF" or "TAB" or "CR".
My barcode scanners send the TAB because we use it also in other web applications where the TAB is triggering a new textbox.

Hope that I have explained it.


The barcode scanner sends a TAB character after the number. If I remember correctly, "tabs" do not work (well) in AI2, but a tab may be present as an invisible character. You can probably test this by getting the length of the text after a scan and comparing this with the length of the visible characters, or try a replacement block to remove the \t and see if it reduces the length. If a tab does exist, then you should be able to work with it.

\t = tab

1 Like

you might want to try the KeyEvent extension


@Taifun thanks for pointing out to this extension.

This should be the solution but only if I figure out how to use it :slight_smile:

I'm getting this error:

Argument #2 (com.google.appinventor.components.runtime.TextB...) to 'cn.zzq.KeyEvent.KeyEvent.Arrangement(com.google.appinventor.components.runtime.HVArrangement)' has wrong type (com.google.appinventor.components.runtime.TextBox) (expected: com.google.appinventor.components.runtime.HVArrangement)

What am I doing:
"Pocni" is the screen name
"txtRadniNalog" is the textbox where I want to catch the Tab key.

What am I doing wrong?
Could not find any documentation on how to use this extension.

this archived page is all we have

it looks like you have to put your textbox into a horizontal arrangement and use that for the Arrangement property of the extension


Have you confirmed that you are getting a TAB returned to the textbox yet ?

@TIMAI2 Yes, it moves the focus to the next control from the textbox.

@Taifun I did put the horizontal arrangement HARadniNalog, then there is no error, but also nothing happens, no events, I have also tried without the IF block, but nothing

Thanks guys for helping me out with this.
I think that I will go with the number of characters in the textbox. My barcode is always 6 char long. I will use @Taifun Taifuntextbox extension or @Gordon_Lu TextboxUtil extension to count the length.

Thanks once again,

the author of the extension @Zhangzqs might want to explain what needs to be done to get the extension running...