[REF] barcodes: make key repeat prevention optional

This functionality was an attemps to fix the chair-to-keyboard
interface in the PoS. Since it is not a standard behaviour, it
must be explicitly requested.
This commit is contained in:
Arthur Maniet
2015-07-30 07:55:52 +02:00
parent 5b01eca5e4
commit 47262c8587
@@ -130,10 +130,12 @@ var BarcodeEvents = core.Class.extend(mixins.PropertiesMixin, {
}
},
start: function(){
start: function(prevent_key_repeat){
document.body.addEventListener('keypress', this.__handler, true);
document.body.addEventListener('keydown', this.__keydown_handler, true);
document.body.addEventListener('keyup', this.__keyup_handler, true);
if (prevent_key_repeat === true) {
document.body.addEventListener('keydown', this.__keydown_handler, true);
document.body.addEventListener('keyup', this.__keyup_handler, true);
}
},
stop: function(){