How to catch input on document[keypress] on window in javascript from Zebra mc330m scanner?

↘锁芯ラ 提交于 2021-01-29 08:18:17

问题


I configured the scanner to send Enter at the end of the input and js reads it correctly but the other characters are lost.

I have tried to decode the input characters with event.keyCode, event.which, event.charCode and nothing works. If I attach it to normal input it works. It also works in the browser address bar (chrome). But when I attach it to the document['onkeypress'] it doesn't read the characters.

I tried Martin Orth solution from here: https://developer.zebra.com/thread/35513 but I couldn't make it work I even don't know if it's the same scanner.

From here I understood that the scanner is sending ASCII characters and javascript has no mechanizm to read them? https://developer.zebra.com/thread/34536

If anyone knows the solution to this problem, help is highly appreciated. I prefer with js/jquery if it is possible at all.

来源:https://stackoverflow.com/questions/54768603/how-to-catch-input-on-documentkeypress-on-window-in-javascript-from-zebra-mc33

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!