2
如何將keycode發送到正在wine下運行的linux中的當前正在運行的應用程序?我希望它爲了簡單而受到歡迎。用bash腳本發送keycode到Xorg + wine
如何將keycode發送到正在wine下運行的linux中的當前正在運行的應用程序?我希望它爲了簡單而受到歡迎。用bash腳本發送keycode到Xorg + wine
使用包叫做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