[IMP] barcode_events: implement a new way of dealing with barcode events
Implement a new way of dealing with barcode events. This was necessary because the old way of dealing with input coming from barcode devices did not stop keyevents. This lead to all kinds of issues (eg. barcode reader output being inserted as tender in a paymentline). This new class inserts itself so that it handles all keyevents before everything else. This means that it has authority on what keypress events pass and which ones do not. It differentiates between 'real' keyboard input and input coming from devices by buffering events. When a certain amount of events come in fast enough, it is handled as a barcode and a 'barcode_scanned' event is emitted on core.bus. When buffered events are decided to not be a barcode, they are recreated and redispatched.
Showing
- addons/web/static/src/js/framework/barcode_events.js 118 additions, 0 deletionsaddons/web/static/src/js/framework/barcode_events.js
- addons/web/static/src/js/web_client.js 5 additions, 0 deletionsaddons/web/static/src/js/web_client.js
- addons/web/views/webclient_templates.xml 1 addition, 0 deletionsaddons/web/views/webclient_templates.xml
Loading
Please register or sign in to comment