Skip to main content

Frequently Asked Questions

Why is my soft trigger button continually firing?

A page can include a button which is used to start scanning, such as the following element:

<button id="start" onclick="DLBarcodeMgr.startDecode()">Start Scan</button>

If the scanner settings are left at default values, this can cause the scanner to re-trigger non-stop until you aim the scanner away from a barcode label.

The reason for this is that the WEDGE_KEYBOARD_ENABLE property is enabled by default. When enabled, the scan result is sent to the web page as keyboard events, as if each letter was typed. Since the button on the page currently has input focus, all of the keyboard input goes to the button. This also includes the LABEL_SUFFIX property, which by default is [LF]. The final character is interpreted by the button as an onclick event, which repeats the scan trigger process again (forever).

There are multiple ways to avoid this behavior. Here are three alternative solutions:

  1. Disable the button when clicked, then enable button on scan/timeout event (once the label has been read). See the barcode.html sample page in the SDK distribution for an example of this approach.

  2. Use the ontouchstart event instead of onclick. This event only responds to touch events and does not respond to keyboard input.

    <button id="start" ontouchstart="DLBarcodeMgr.startDecode()">Start Scan</button>
  3. Disable keyboard wedge before scan. This prevents the label data from being sent to the button.

    DLBarcodeMgr.setProperty(BcdPropIds.WEDGE_KEYBOARD_ENABLE, false);

What SDK do I use to access the camera (or other peripherals)?

The Datalogic JavaScript SDK does not contain specific APIs for managing the camera or other peripherals, such as the microphone and device location. These can be managed instead by using APIs available as part of the HTML 5 standard, which are supported by the Browser.

Here are links to HTML 5 documentation/guides on these topics:

Audio/Video APIs

Location API