J JimAvanti Member Licensed User Longtime User Nov 29, 2018 #1 I have a program that uses a Bluetooth barcode scanner (Which installs as a keyboard) to scan serial numbers and display the record for that serial number. There are other Textboxes that you can click on to change fields of the displayed record. The problem I am having is I need the softkeyboard to display if I click on one of the editable text boxes. With the barcode scanner turned on the soft keyboard never displays. Is there a way I can Display the softkeyboard if certain textboxes have focus and not display it if the textbox I use for the scanner has focus? Thanks, Jim
I have a program that uses a Bluetooth barcode scanner (Which installs as a keyboard) to scan serial numbers and display the record for that serial number. There are other Textboxes that you can click on to change fields of the displayed record. The problem I am having is I need the softkeyboard to display if I click on one of the editable text boxes. With the barcode scanner turned on the soft keyboard never displays. Is there a way I can Display the softkeyboard if certain textboxes have focus and not display it if the textbox I use for the scanner has focus? Thanks, Jim
J JimAvanti Member Licensed User Longtime User Nov 30, 2018 #3 I did look quick at that library when searching for answers, but it didn't look like it would work for me. I guess I need to give it another look tomorrow... Thanks, Jim mangojack said: IME Keyboard library ... Click to expand... Upvote 0
I did look quick at that library when searching for answers, but it didn't look like it would work for me. I guess I need to give it another look tomorrow... Thanks, Jim mangojack said: IME Keyboard library ... Click to expand...
klaus Expert Licensed User Longtime User Nov 30, 2018 #4 ... have focus and not display it if the textbox I use for the scanner has focus? Click to expand... Do you really need an EditText for displaying the value of the scanner, couldn't you use a Label for that instead of an EditText? Upvote 0
... have focus and not display it if the textbox I use for the scanner has focus? Click to expand... Do you really need an EditText for displaying the value of the scanner, couldn't you use a Label for that instead of an EditText?
J JimAvanti Member Licensed User Longtime User Nov 30, 2018 #5 I am using an EditText which is actually "off-screen" to capture (On EnterPressed) the serial number of an item. I then search through the database and if that serial number is found it will display the item, but it also gives the option to change some of the data (such as location and status of the item). Those fields require a software keyboard. When idle, I set focus back to the EditText that the scanner uses so it is ready to read another serial number. The program did work the way I wanted it to but I had the problem of the program restarting and clearing the database changes every time the Bluetooth scanner would turn on/off which I was able to fix by adding the line: SetActivityAttribute(Main, android:configChanges,"keyboard|keyboardHidden|navigation") to the Manifest. After editing the manifest, the scanner turning on/off did not affect the program restarting, but ever since then when I click on a text field to edit, the softkeyboard does not show up. Fixing one step at a time... Jim klaus said: Do you really need an EditText for displaying the value of the scanner, couldn't you use a Label for that instead of an EditText? Click to expand... Upvote 0
I am using an EditText which is actually "off-screen" to capture (On EnterPressed) the serial number of an item. I then search through the database and if that serial number is found it will display the item, but it also gives the option to change some of the data (such as location and status of the item). Those fields require a software keyboard. When idle, I set focus back to the EditText that the scanner uses so it is ready to read another serial number. The program did work the way I wanted it to but I had the problem of the program restarting and clearing the database changes every time the Bluetooth scanner would turn on/off which I was able to fix by adding the line: SetActivityAttribute(Main, android:configChanges,"keyboard|keyboardHidden|navigation") to the Manifest. After editing the manifest, the scanner turning on/off did not affect the program restarting, but ever since then when I click on a text field to edit, the softkeyboard does not show up. Fixing one step at a time... Jim klaus said: Do you really need an EditText for displaying the value of the scanner, couldn't you use a Label for that instead of an EditText? Click to expand...
KMatle Expert Licensed User Longtime User Nov 30, 2018 #6 Did you see my example? https://www.b4x.com/android/forum/threads/use-a-handheld-bluetooth-scanner-via-spp-mode.83490/ Change the scan mode to SPP. With that you'll receive the data as a stream. No keyboard needed. Upvote 0
Did you see my example? https://www.b4x.com/android/forum/threads/use-a-handheld-bluetooth-scanner-via-spp-mode.83490/ Change the scan mode to SPP. With that you'll receive the data as a stream. No keyboard needed.
J JimAvanti Member Licensed User Longtime User Nov 30, 2018 #7 I think I might have fixed the problem using IME, but like an idiot I took the Bluetooth keyboard home to test it and forgot to bring it back to work. I did get some IME code to compile though. I added the Global Code: Copy Dim IME1 As IME I added this Sub for the EditText I want to show the keyboard: Code: Copy Sub StatusText_FocusChanged (HasFocus As Boolean) If HasFocus = True Then IME1.ShowKeyboard(StatusText) End If End Sub And this for the Scanner that I don't want the keyboard to show: Code: Copy Sub Text1_FocusChanged (HasFocus As Boolean) If HasFocus = True Then IME1.HideKeyboard() End If End Sub I have hope that it will work. At least I know it runs. Thanks, Jim mangojack said: IME Keyboard library ... Click to expand... Upvote 0
I think I might have fixed the problem using IME, but like an idiot I took the Bluetooth keyboard home to test it and forgot to bring it back to work. I did get some IME code to compile though. I added the Global Code: Copy Dim IME1 As IME I added this Sub for the EditText I want to show the keyboard: Code: Copy Sub StatusText_FocusChanged (HasFocus As Boolean) If HasFocus = True Then IME1.ShowKeyboard(StatusText) End If End Sub And this for the Scanner that I don't want the keyboard to show: Code: Copy Sub Text1_FocusChanged (HasFocus As Boolean) If HasFocus = True Then IME1.HideKeyboard() End If End Sub I have hope that it will work. At least I know it runs. Thanks, Jim mangojack said: IME Keyboard library ... Click to expand...
J JimAvanti Member Licensed User Longtime User Dec 1, 2018 #8 MJ, I did try the IME Library, but it still didn't show the softkeyboard. I think I may be needing to switch the Scanner to serial mode if it supports that. You would think it would be easy to select between software keyboard and hardware keyboard, especially since there are many keyboard devices that are not actually keyboards. If you get a chance, check my replies to see how I used IME to make sure I was doing it correctly. Thanks, Jim JimAvanti said: I did look quick at that library when searching for answers, but it didn't look like it would work for me. I guess I need to give it another look tomorrow... Thanks, Jim Click to expand... mangojack said: IME Keyboard library ... Click to expand... Upvote 0
MJ, I did try the IME Library, but it still didn't show the softkeyboard. I think I may be needing to switch the Scanner to serial mode if it supports that. You would think it would be easy to select between software keyboard and hardware keyboard, especially since there are many keyboard devices that are not actually keyboards. If you get a chance, check my replies to see how I used IME to make sure I was doing it correctly. Thanks, Jim JimAvanti said: I did look quick at that library when searching for answers, but it didn't look like it would work for me. I guess I need to give it another look tomorrow... Thanks, Jim Click to expand... mangojack said: IME Keyboard library ... Click to expand...
mangojack Expert Licensed User Longtime User Dec 1, 2018 #9 At a quick glance the code looks OK and should have worked . Did you try @KMatle 's example suggested post#6. ?? Other than that, maybe you could upload a small sample project highlighting your issue ... Menu > File > Export as Zip Maybe someone who has / uses a scanner can then help. Upvote 0
At a quick glance the code looks OK and should have worked . Did you try @KMatle 's example suggested post#6. ?? Other than that, maybe you could upload a small sample project highlighting your issue ... Menu > File > Export as Zip Maybe someone who has / uses a scanner can then help.