开发者

How to send the output of a software to a Microsoft Windows Virtual Keyboard?

开发者 https://www.devze.com 2022-12-16 13:38 出处:网络
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?

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 -


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号