you can then run the command keyrepeat 100 \”1\” or what ever you chose as the filename of your script.
You will have 5 seconds to focus a window, the program will then simulate a user pressing the keys on the keyboard.
sleep 5 #delay to allow the user to focus a window number=$1 #first parameter, number of times to repeat text=$2 #second parameter, text to repeat will interpret as tab for ((counter=1;counter< =$number;counter+=1)); do #loop required number of times xvkbd -xsendevent -text $text #this sends the text as key presses done
Related articles by Zemanta
- Google search in command line \” Linux by Examples (linux.byexamples.com)
- Qjoypad: Keyboard to Gamepad Mapping for Linux (maketecheasier.com)
- Emacs Macros and the Power-Macros Package | Linux Journal (linuxjournal.com)