views:

33

answers:

2

I am using xvkdb with X11 to send the content of my Barcode reader to the Keyboard Focus Window.

But I am looking to port this Barcode Reader on Microsoft Windows. How would you do that?

Here is the bash script :

zbarstream /dev/video | xvkbd -file -
+1  A: 

If you just want to copy text, use the clipboard. There are many command line utilities that allow you to copy text to the clipboard. I use my own, very simple 5-lines Delphi pascal. You can find such a utility in Raymond Chen blog the new old thing http://blogs.msdn.com/oldnewthing/archive/2009/11/10/9919908.aspx

This method provides an additional safety that is the user must paste the text into the application, but this additional required action may be undesirable. In that case, or if you need more detailed control, then you need some way to inject keystrokes into the keyboard driver. There are some keyboard simulators and keyboard automation utilities. AutoIT and AutoHK are very popular.

PA
That is a very good idea actually. Thank you.
Natim
A: 

AFAIK, the On-Screen Keyboard included in Windows doesn't have a command-line interface and therefore doesn't support input redirection. I'm not sure about other third-party virtual keyboards as I have never used any.

However, there's the SendKeys scripting method that can be used to simulate keyboard input into the active window. So if you launch your Barcode Reader and capture its output from a script (VBScript/JScript), you should be able to use SendKeys to send that output to the active window.

Helen