Keayboard vs. Barcode scanner

Hi,
I’m trying to get my first application in Framework7.
I guess I took a big bite. I don’t know what to do with the keyboard.
Thank you for any help or idea how to solve the problem.

My goal:
Application running on Android device ZEBRA TC25.
Input form. The EAN code is read by the scanner, the device inserts the EAN into the input field.
The problem is the keyboard that opens automatically when focus input is made.
The user must not enter anything into input - only barcode scanner data.

Attempt 1 - NOT WORKING (https://pastebin.com/ai2gqKKb)



Barcode





// Page Events
on: {
pageInit: function(e, page) {
var self = this;
console.log(‘acrivate blur():’);
document.getElementById(“barcode_1”).blur();

**Attempt 2 - NOT WORKING ** (https://pastebin.com/pVCaYr0D)
app/cordova/config.xml
add:


**Attempt 3 - NOT WORKING ** (https://pastebin.com/LQcg7rf9)
app/cordova/config.xml
add:


**Attempt 4 - NOT WORKING ** (https://pastebin.com/8sinGQef)
app/cordova/config.xml
add:


**Attempt 5 - NOT WORKING ** (https://pastebin.com/aXRDt2DJ)
app/cordova/platforms/android/app/src/main/AndroidManifest.xml
add:

    <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="stateAlwaysHidden">

I’m sorry, I can’t insert the code, I used pastebin.

Hello, I have experience with barcodes and phonegap/electron. Is this a USB barcode scanner? Typically they just emulate a keyboard.

What I did was

$$('.your-text-input').focus();

$$('.your-text-input').blur(function () {//forces it to stay active
       $$('.your-text-input').focus();
});

 $$('.your-text-input').keyup(function (e) {
                    if (e.keyCode === 13) {//key 13 is enter, which the barcode scanner does
                      //code after scan
              }
       });

Unfortunately, this only works on the HW keyboard.
When installing the USB barcode reader, the reader is installed as a new HW keyboard. This causes the SW keyboard to be turned off.

I use Reader is an Android device with integrated scanner.
The main problem is the open keyboard software when scanning.

While trying the offered solution is focus on input but sw keyboard is still open. I don’t need to display the sw keyboard at all. :frowning:

Hello
try with this

            <input type="text" name="ean_1" id="barcode_1" readonly="readonly"  placeholder="Naskenujte čárový kód" class="" autofocus required>

Right solution

 methods: {
            InputFocusKeyboard: function(input_id){
                var yourInput = document.getElementById(input_id);
                yourInput.readOnly = true;
                yourInput.focus();
                setTimeout(function(){
                    document.getElementById(input_id).removeAttribute('readonly');
                }, 100);
            },
        },
2 Likes