[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:
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user