Hacker News new | ask | show | jobs
by lazulicurio 1397 days ago
Do you have the scanner set up as a keyboard wedge (USB-HID)? From your description, it sounds like it. Usually when dealing with control characters it's easier to put scanners in virtual COM mode. Although using them as a COM device does carry its own set of issues. I'm more familiar with honeywell and cognex scanners, but quickly browsing the realinn documentation I don't see a character replacement functionality.
1 comments

Yes, the scanner is operating as a keyboard HID. I'll look into whether virtual COM could work. Will that still let it type into random webapp pages (how I use it now), or does that tie it rigidly to specific applications? (This question is based on this language from the Realinn manual - "9.2 USB virtual COM mode In USB virtual COM mode, the scanner needs to work with driver and serial software.Expected final behavior is that even if you open up another page, the scanned information will show up in the window of serial software. Please let us know if you need to set it to USB virtual COMmode,we will send you the driver."

I assume that Virtual COM works with both USB and bluetooth?

If you're entering into a webpage, your best bet may be a different scanner. Virtual COM generally ties it to native applications (website COM interfaces are possible, but I'm assuming the website isn't yours to modify).

Another possibility is writing a native app that works like a shim: reading from the COM port and using APIs (e.g. SendKeys on Windows) to re-transmit the characters as keystrokes. But the most robust solution is probably a different scanner.

The website is mine to modify. I wouldn't go to great lengths to change things to support virtual COM, but if it's just a question of adding a few lines of javascript to listen to virtual COM and map to keypress events that would be possible.