mrothenbuecher / bcscanner

jquery plugin for HID barcode scanner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bcscanner

jquery plugin for HID barcode scanner

usage

// with default values
$('#bcscanner').bcscanner();

// with custom options
$('#bcscanner').bcscanner({
  hidden: true,
  interval: 300,
  onChar: [{
    charCode: 13,
    func: function() {
      alert("enter was hit");
    }
  }, {
      charCode: 32,
      func: function() {
        alert("space was hit");
      }
    }]
  });

options

hidden (boolean)

  • true, input field will be moved out of visible area
  • false, input field stays in position

default is true

interval (int)

the interval (in ms) in which the field requests the focus. If interval < 0 the focus will not be requested.

default is 50

onChar (array of objects)

Defines functions depending of a charCode

{
  charCode: 13,
  func: function(input, event) {
    alert("enter was hit");
  }
}

methods

start([interval])

starts the focus requesting interval

stop()

stops the focus requesting interval

destroy()

removes bcscanner

About

jquery plugin for HID barcode scanner


Languages

Language:JavaScript 61.7%Language:HTML 33.8%Language:CSS 4.5%