Detect when input box filled by keyboard and when by barcode scanner.
I wrote this answer, because my Barcode Scanner Motorola LS1203 generated keypress event, so I can’t use Utkanos’s solution. My solution is: var BarcodeScanerEvents = function() { this.initialize.apply(this, arguments); }; BarcodeScanerEvents.prototype = { initialize: function() { $(document).on({ keyup: $.proxy(this._keyup, this) }); }, _timeoutHandler: 0, _inputString: ”, _keyup: function (e) { if (this._timeoutHandler) { clearTimeout(this._timeoutHandler); this._inputString … Read more