Serial Input for Windows

Over time I end up writing a lot of little programs and scripts just to get through a particular use-case.

Here’s one of them.

So there’s this thing in Windows XP called SerialKeys which allows people with insane input devices to generate keyboard and mouse events via their PC’s serial (or COM) port.

It’s an accessibility feature, so presumably is for people who enter braille or blink their way through entering text.

SerialKeys has been dropped from Windows 7, presumably because Microsoft now has the ability to heal the blind.

This should free up some resources which they can now devote to making the desktop look like half a dozen rectangular blocks.

I recently needed to use this feature in order to get input from a Honeywell 4600GSR scanner, which is one of the few scanners around that can convert convert the 2D Australia Post 4-state barcodes into their constituent bits and pieces.

A hand-held honeywell 4600GSR scanner
A hand-held Honeywell 4600GSR scanner

Not a real DPID code
Not a real DPID code

SerialKeys looked as if it could do the job, but unfortunately only works for COM1 through COM4, which was a pity, because the device driver for this thing registered it at what appeared to be an unmoveable COM15.

Control Panel > Acessibility > General tab > SerialKeys
Control Panel > Acessibility Options > General tab > SerialKeys Settings

After mucking about with the registry for a bit, I ended up rewriting the SerialKeys functionality in a separate application, which, in order to prevent being sued to the ends of the accessible earth, I’ve called “Serial Input for Windows”.

And here it is:

Serial Input for Windows screenshot
Serial Input for Windows screenshot

To use it:

  • Open the application
  • Click ‘Enable Serial Input for Windows’
  • Select a COM port, baud rate and other COM settings
  • Click ‘Apply’ and acknowledge the ‘Serial Input for Windows is now listening on COMn’ dialog box.
  • Whilst this app is in the foreground, any input from the selected COM port is displayed in the application’s ‘Test input’ frame
  • If another app is in the foreground, any input from the selected COM port is forwarded to that application

And that’s pretty much it.

If you want it, you can download it here, or grab the source here:

Download application

Download source

If you do plan to compile the application from the source, you’ll need the free Microsoft Visual Studio 2008 Visual Basic Express

A few gotchas if you do plan to use it:

  • It doesn’t implement the full SerialKeys API; in particular mouse control isn’t implemented at all
  • The virtual key mapping is fairly primitive; I just created enough of this to get my particular use-case done. So things like shift+character, ctrl+character etc… probably won’t work.
  • I haven’t tried it in any OS other than Windows XP, so don’t be surprised if Vista/7/Metro etc consider the whole program a security breach and prevent it from working anyway. Progress.
  • Because this is a .NET app, I haven’t gone through the whole maven build rigmarole (I did look at NPanday many moons ago, but there’s a bug in there that prevented me from using it). Although there’s a patch for it now, so maybe I’ll give it another shot.

Some links which were useful in the making of this thing:

Note that some of these links may cover fairly basic topics, but I’m not really a .NET developer.

Enjoy 🙂

Update 2021-01-09 Source code is up on github:



Add a Comment

Your email address will not be published. Required fields are marked *