如何将软件的输出发送到 Microsoft Windows 虚拟键盘?

发布于 2024-08-18 09:07:34 字数 195 浏览 2 评论 0原文

我将 xvkdb 与 X11 结合使用,将条形码阅读器的内容发送到键盘焦点窗口。

但我希望将此条形码阅读器移植到 Microsoft Windows 上。你会怎么做?

这是 bash 脚本:

zbarstream /dev/video | xvkbd -file -

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 -

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柳絮泡泡 2024-08-25 09:07:34

如果您只想复制文本,请使用剪贴板。有许多命令行实用程序允许您将文本复制到剪贴板。我使用我自己的、非常简单的 5 行 Delphi pascal。您可以在 Raymond Chen 博客新旧事物中找到这样的实用程序http://blogs.msdn.com/oldnewthing/archive/2009/11/10/9919908.aspx

此方法提供了额外的安全性,即用户必须将文本粘贴到应用程序中,但这种额外的必需操作可能是不可取的。在这种情况下,或者如果您需要更详细的控制,那么您需要某种方法将击键注入键盘驱动程序。有一些键盘模拟器和键盘自动化实用程序。 AutoITAutoHK非常受欢迎。

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.

花落人断肠 2024-08-25 09:07:34

AFAIK,Windows 中包含的屏幕键盘没有命令-line 接口,因此不支持输入重定向。我不确定其他第三方虚拟键盘,因为我从未使用过任何键盘。

但是,有 SendKeys 脚本方法可用于模拟活动窗口中的键盘输入。因此,如果您启动条形码读取器并从脚本 (VBScript/JScript) 捕获其输出,您应该能够使用 SendKeys 将该输出发送到活动窗口。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文