Keyboard output Datawedge with javascript

I'm trying to read barcodes into a PWA on my TC25. But I cannot find out how to listen for the ASCII chars Datawedge outputs.

I know I'm not the first to have this question, but all answers so far weren't of any use to my case.

If I listen for keyup or keydown I don't get any charCodes... I get the feeling I'm overlooking something, I can't imagine it should be this hard to use the integrated scanner on the TC25.