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