|
|
@ -92,14 +92,11 @@ odoo.define('pos_keyboard.pos', function (require) { |
|
|
|
var type = this.pos.keypad.type; |
|
|
|
if (data.type === type.numchar){ |
|
|
|
this.state.appendNewChar(data.val); |
|
|
|
} |
|
|
|
else if (data.type === type.bmode) { |
|
|
|
} else if (data.type === type.bmode) { |
|
|
|
this.state.changeMode(data.val); |
|
|
|
} |
|
|
|
else if (data.type === type.sign){ |
|
|
|
} else if (data.type === type.sign){ |
|
|
|
this.clickSwitchSign(); |
|
|
|
} |
|
|
|
else if (data.type === type.backspace){ |
|
|
|
} else if (data.type === type.backspace){ |
|
|
|
this.clickDeleteLastChar(); |
|
|
|
} |
|
|
|
} |
|
|
@ -190,10 +187,10 @@ odoo.define('pos_keyboard.pos', function (require) { |
|
|
|
// KeyCode: Escape (Keypad 'esc')
|
|
|
|
var KC_ESCAPE = 27; |
|
|
|
var kc_lookup = { |
|
|
|
48: '0', 49: '1', 50: '2', 51: '3', 52: '4', |
|
|
|
48: '0', 49: '1', 50: '2', 51: '3', 52: '4', |
|
|
|
53: '5', 54: '6', 55: '7', 56: '8', 57: '9', |
|
|
|
80: 'p', 83: 's', 68: 'd', 190: '.', 81: 'q', |
|
|
|
96: '0', 97: '1', 98: '2', 99: '3', 100: '4', |
|
|
|
96: '0', 97: '1', 98: '2', 99: '3', 100: '4', |
|
|
|
101: '5', 102: '6', 103: '7', 104: '8', 105: '9', |
|
|
|
106: '*', 107: '+', 109: '-', 110: '.', 111: '/' |
|
|
|
}; |
|
|
@ -203,7 +200,7 @@ odoo.define('pos_keyboard.pos', function (require) { |
|
|
|
var ok = false; |
|
|
|
var timeStamp = 0; |
|
|
|
$('body').on('keyup', '', function (e){ |
|
|
|
var statusHandler = !rx.test(e.target.tagName) || |
|
|
|
var statusHandler = !rx.test(e.target.tagName) || |
|
|
|
e.target.disabled || e.target.readOnly; |
|
|
|
if (statusHandler){ |
|
|
|
var is_number = false; |
|
|
@ -259,7 +256,9 @@ odoo.define('pos_keyboard.pos', function (require) { |
|
|
|
timeStamp = new Date().getTime(); |
|
|
|
|
|
|
|
setTimeout(function(){ |
|
|
|
if (ok) {self.action_callback(self.data);} |
|
|
|
if (ok) { |
|
|
|
self.action_callback(self.data); |
|
|
|
} |
|
|
|
}, 50); |
|
|
|
} |
|
|
|
}); |
|
|
|