|
@ -2,6 +2,7 @@ |
|
|
Copyright 2016 ufaks <https://github.com/ufaks>
|
|
|
Copyright 2016 ufaks <https://github.com/ufaks>
|
|
|
Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
|
|
|
Copyright 2016 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
|
|
|
Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/kolushovalexandr>
|
|
|
Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/kolushovalexandr>
|
|
|
|
|
|
Copyright 2019 ssaid <https://github.com/ssaid>
|
|
|
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */
|
|
|
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */
|
|
|
odoo.define('pos_keyboard.pos', function (require) { |
|
|
odoo.define('pos_keyboard.pos', function (require) { |
|
|
"use strict"; |
|
|
"use strict"; |
|
@ -134,6 +135,7 @@ odoo.define('pos_keyboard.pos', function (require) { |
|
|
val: undefined |
|
|
val: undefined |
|
|
}; |
|
|
}; |
|
|
this.action_callback = undefined; |
|
|
this.action_callback = undefined; |
|
|
|
|
|
this.active = false; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
save_callback: function(){ |
|
|
save_callback: function(){ |
|
@ -159,6 +161,9 @@ odoo.define('pos_keyboard.pos', function (require) { |
|
|
// calling the callback when needed.
|
|
|
// calling the callback when needed.
|
|
|
connect: function(){ |
|
|
connect: function(){ |
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
if (self.active) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
// --- additional keyboard ---//
|
|
|
// --- additional keyboard ---//
|
|
|
// KeyCode: + or - (Keypad '+')
|
|
|
// KeyCode: + or - (Keypad '+')
|
|
|
var KC_PLU = 107; |
|
|
var KC_PLU = 107; |
|
@ -258,11 +263,13 @@ odoo.define('pos_keyboard.pos', function (require) { |
|
|
}, 50); |
|
|
}, 50); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
self.active = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// stops catching keyboard events
|
|
|
// stops catching keyboard events
|
|
|
disconnect: function(){ |
|
|
disconnect: function(){ |
|
|
$('body').off('keyup', ''); |
|
|
$('body').off('keyup', ''); |
|
|
|
|
|
self.active = false; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|