使用bash脚本将密钥代码发送到Xorg + wine [英] Sending keycode to Xorg + wine with bash script

查看:108
本文介绍了使用bash脚本将密钥代码发送到Xorg + wine的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将密钥代码发送到在wine下运行的linux中当前正在运行的应用程序?为了简单起见,我希望它能受到重击.

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.

推荐答案

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

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

xvkbd -text [line of keycodes]

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

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

这篇关于使用bash脚本将密钥代码发送到Xorg + wine的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆