Sending keycode to Xorg + wine with bash script
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
Sending keyboard input to a program from command-line
xdotool
does have a way of sending keystrokes if limited to a focused window:
WID=`xdotool search "Mozilla Firefox" | head -1`
xdotool windowactivate $WID
xdotool key ctrl+l
Related Topics
How Can a Process Try to Access Other Process's Memory in Linux Virtual Memory System
Shell Command to Update Pom File from a Variable
Error Marking Master: Timed Out Waiting for the Condition [Kubernetes]
What Does Version Info in Ldd -V Mean
How to Replace a Multi Line String in a Bunch Files
What Happened to Socket If Network Has Broken Down
Git Clone from Linux to Tfs Git Repo
Linux: Instantiate from User-Space:Eeprom New_Device
Bluetooth Error: Native Library Bluecove_Arm Not Available
Loading Executable or Executing a Library
Parsing Data from Ifconfig with Awk or Sed
Access Bash Positional Parameter Through Variable
Linux Iterate Over Files in Directory
Does Using Xvfb to Run Opengl Effects Version
How to Pass Command Line Parameters with Quotes Stored in Single Variable
How to Fetch the Tags for Ec2-Describe-Instances in a Shell Script