TC25 keystroke output not raising javascript keypress event

I'm trying to capture barcode data from the internal scanner on HTML5 page without an input field to prevent the android keyboard popup.

The code works perfectly on our TC51, but the keypress event is not fired on the TC25.

The Datawedge configuration is the same on both devices. 

TC51 Datawedge v6.6.47

Keystroke output : Enabled

Action key : none

Advanced data formatting, Basic data formatting : Disabled.

The following event has been added to the page

    document.addEventListener("keypress", function (e) {

        if (e.target.tagName !== "INPUT") {

            $("#barcodeInputHidden").val($("#barcodeInputHidden").val() + e.key);

            $("#barcode").append(e.key);

            if (!barcodeTimerRunning) { barcodeTimerStart(); }

            e.preventDefault();

        }

    });

    function barcodeTimerStart() {

        barcodeTimerRunning = true;

        setTimeout(function () {

            var barcode = $("#barcodeInputHidden").val();

            evaluateBarcodeInput(barcode);

            console.log('barcode : ' + barcode);

            $("#barcode").html("");

            $("#barcodeInputHidden").val("");

            barcodeTimerRunning = false;

        }, 500);

    }

Anonymous (not verified)
Not sure why the code which

Not sure why the code which runs on the TC56 is not working on the TC25 but the sample page attached works for barcode input with no popup keyboard using the default Datawedge Profile 0 and Chrome on the TC25.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Martin Orth
Hi Martin,I had the sampe

Hi Martin,

I had the sampe problem while developing a web only app for the TC25 spending two full days on that damn problem. I solved it using Advanced Data Formatting and creating a rule that output a decoded

barcode char by char with a pause between each char and sending a carriage return at the end. I tested it with the jquery scannerDetection plugin and it worked like a charm.

Thanks

Martin

PS: Dear Zebra Community Manager. This hint will save a lot of frustrating time of your developer community. I have the powerpack and single charging cradle on my wishlist. ;-)

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


WIktor Debski
Hello Can you provide more

Hello Can you provide more information about the way you did this advanced formatting, because we also have similiar issue with tc25. Configuration photo or description will be nice

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anders Grandt
Same Issue

Did you find any solution to this?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Bastian Fellner
Possible solution

We experienced the same problem but even within the same model (both TC25).
One device would simply not output any characters.
DataWedge Version is 7.0.4 on both devices.

Solution:
The faulty scanner works if within the active DataWedge profile the "Delay between characters" value in the "Keystroke output" section
is set from the default of "0 ms" to a value > "0 ms" (e.g. 1 ms).
(We are running a German firmware on the devices - so I am guessing the correct English labeling here).
We also noticed differing versions of the "2D Barcode Imager" (*-R03=ok; *-R01=not ok)
Happy Holidays!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
Thank you, I have seen this

Thank you, I have seen this question a few times and although for some users the delay works, for others (on other devices or different Android versions) the delay does not work.  What does seem to work reliably is adding a return (0x0D) character between each character - Option 3 in this deck: http://www.darryncampbell.co.uk/wp-content/uploads/2019/10/AppForum-NALA-2019-Using-JavaScript-Frameworks-when-developing-for-Zebra.pdf

This use case was addressed properly in DataWedge 7.3 for SD660 devices (though this question relates to a TC25 which is not SD660).  For more info on this solution please see https://developer.zebra.com/blog/listening-keypress-events-datawedge

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments