D dim Member Licensed User Longtime User Sep 25, 2016 #1 Hi all, I have an edittext with an "EnterPressed" event that does something (beeps). Using the device's keyboard I can write in the edittext and then pressing the device's keyboard's "Enter key" the EnterPressed event is fired fine. Now I added a button that generates a string and pressing it, code is : Code: Button1.Text = "abc" EditText1.Text = Button1.Text So the text that the button generates is written in the Editext. No EnterPressed event so far. So I changed code to : Code: Button1.Text = "abc" & CRLF but still EnterPressed event is not fired. What I am doing wrong ? Thank you
Hi all, I have an edittext with an "EnterPressed" event that does something (beeps). Using the device's keyboard I can write in the edittext and then pressing the device's keyboard's "Enter key" the EnterPressed event is fired fine. Now I added a button that generates a string and pressing it, code is : Code: Button1.Text = "abc" EditText1.Text = Button1.Text So the text that the button generates is written in the Editext. No EnterPressed event so far. So I changed code to : Code: Button1.Text = "abc" & CRLF but still EnterPressed event is not fired. What I am doing wrong ? Thank you
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2016 #2 Just call the sub yourself. Code: Button1.Text = "abc" EditText1.Text = Button1.Text EditText1_EnterPressed Upvote 0
Just call the sub yourself. Code: Button1.Text = "abc" EditText1.Text = Button1.Text EditText1_EnterPressed
D dim Member Licensed User Longtime User Sep 25, 2016 #3 Thank you Erel, but may I ask what is the actual difference between calling the "Enterpressed" myself and adding the CRLF in the end of the string ? Upvote 0
Thank you Erel, but may I ask what is the actual difference between calling the "Enterpressed" myself and adding the CRLF in the end of the string ?
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2016 #4 The EnterPressed event is raised when the user clicks on the enter or done button. It is not raised when the text is changed programmatically. Upvote 0
The EnterPressed event is raised when the user clicks on the enter or done button. It is not raised when the text is changed programmatically.
D dim Member Licensed User Longtime User Sep 25, 2016 #5 So, if I use barcode scanner that sends CRLF automatically after the string that it scans, it wont automatically submit in my android app ? Upvote 0
So, if I use barcode scanner that sends CRLF automatically after the string that it scans, it wont automatically submit in my android app ?
fixit30 Active Member Licensed User Longtime User Sep 25, 2016 #6 Yes. That is correct. It would be better to use the barcode scanner in SPP mode and use AsyncStreams. Upvote 0
Yes. That is correct. It would be better to use the barcode scanner in SPP mode and use AsyncStreams.
D dim Member Licensed User Longtime User Sep 25, 2016 #7 Thank you. As I wrote, the barcode scanner includes the CRLF after every string it sends. If the component cannot use it, maybe it's better me to try to read it in the string that it's been written. Is that correct ? Upvote 0
Thank you. As I wrote, the barcode scanner includes the CRLF after every string it sends. If the component cannot use it, maybe it's better me to try to read it in the string that it's been written. Is that correct ?
fixit30 Active Member Licensed User Longtime User Sep 25, 2016 #8 You could try handling the EditText1_TextChanged event. It seems to work! Code: Sub EditText1_TextChanged (Old As String, New As String) If New.EndsWith(CRLF) Then EditText1_EnterPressed End If End Sub Upvote 0
You could try handling the EditText1_TextChanged event. It seems to work! Code: Sub EditText1_TextChanged (Old As String, New As String) If New.EndsWith(CRLF) Then EditText1_EnterPressed End If End Sub
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2016 #9 dim said: So, if I use barcode scanner that sends CRLF automatically after the string that it scans, it wont automatically submit in my android app ? Click to expand... It will probably cause the event to be raised as the barcode sends key strokes events. You need to test it. Upvote 0
dim said: So, if I use barcode scanner that sends CRLF automatically after the string that it scans, it wont automatically submit in my android app ? Click to expand... It will probably cause the event to be raised as the barcode sends key strokes events. You need to test it.
D dim Member Licensed User Longtime User Sep 25, 2016 #10 Thank you guys, tomorrow I receive my barcode scanner and will test it. BTW, Erel your development platform B4* rocks ! Upvote 0
Thank you guys, tomorrow I receive my barcode scanner and will test it. BTW, Erel your development platform B4* rocks !