Barcode scanner and avoiding softkeyboard on mobile devices

So. I’m prototyping Vaadin for usage on mobile devices with a bluetooth barcode scanner. If I have a “barcode” TextField there is the annoying feature of the software keyboard popping up. It’s hard to do anything about that so I thought I’d avoid the field altogether.

Is there a way of binding a general keylistener to the UI or the root layout? I sort of managed to hook up a shortcut listener for keys 0-9 (each one adds a digit to a label and enter searches/clears) but it looks a bit silly. And with some barcodes, that’s not even enough. And on IE the root layout doesn’t get initial focus(?). I’d hate to write own JavaScript for that if it could be avoided…

Also, I noticed that sometimes the input would hang for up to 20 seconds (input not accepted). It never hangs when just notepad. Any theories what might cause this (some events firing too quick?) and what could be done to debug it?

Thanks in advance,

Good news! I got it to hang on notepad, too so Vaadin is off the hook for now! :wink:

But I would still be interested in the “general keypress handler” so I don’t have to meddle with 10 shortcut listeners…