发送键码到 Xorg + 带有 bash 脚本的 wine

发布于 2024-07-23 23:06:47 字数 69 浏览 4 评论 0原文

如何将密钥代码发送到在 wine 下运行的 linux 中当前运行的应用程序? 为了简单起见,我希望它位于 bash 下。

How do I send keycode to currently running application in linux which is running under wine? I would like the it to be under bash for simplicity.

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

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

发布评论

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

评论(1

玩心态 2024-07-30 23:06:47

使用名为xvkbd的包。 它应该存在于每个 Linux 发行版中。 语法很简单:

xvkbd -text [line of keycodes]

例如,运行魔兽争霸 3 游戏并自动登录 Battle.net 将是:

#!/bin/bash
cd ~/.wine/drive_c/Program\ Files/Warcraft3/
wine euroloader.exe -opengl > /dev/null 2> /dev/null & # run W3
sleep 5; # wait until animation fades out
xvkbd -text "b" # "b" is for Battle.net
sleep 7;
xvkbd -text "password\r" # password
sleep 3;
xvkbd -text "h" # "h" is for channel
sleep 5;
xvkbd -text "h" # honestly I don't know why, but without this the script might not work
sleep 5;
xvkbd -text "zcu\r" # type in your channel and join the room
sleep 5;
xvkbd -text ".load\r" # I'm using ghost, so I'll ask him what map is loaded

Use package called xvkbd. It should be within every linux distribution. Syntax is simple:

xvkbd -text [line of keycodes]

For example running Warcraft 3 game with automatic Battle.net login would be:

#!/bin/bash
cd ~/.wine/drive_c/Program\ Files/Warcraft3/
wine euroloader.exe -opengl > /dev/null 2> /dev/null & # run W3
sleep 5; # wait until animation fades out
xvkbd -text "b" # "b" is for Battle.net
sleep 7;
xvkbd -text "password\r" # password
sleep 3;
xvkbd -text "h" # "h" is for channel
sleep 5;
xvkbd -text "h" # honestly I don't know why, but without this the script might not work
sleep 5;
xvkbd -text "zcu\r" # type in your channel and join the room
sleep 5;
xvkbd -text ".load\r" # I'm using ghost, so I'll ask him what map is loaded
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文