Last active
December 29, 2022 03:33
-
-
Save ottosch/1cc25b1b428cbe6c3681b7c21e9bdfff to your computer and use it in GitHub Desktop.
Executes a keystroke repeatedly. Useful when playing emulators :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if [ "$#" -lt "2" ]; then | |
echo "Usage: $0 <key> <times>" | |
echo "Example: $0 c 20 - will press c 20 times" | |
exit 1 | |
fi | |
for _ in $(seq "$2"); do | |
xdotool key "$1" | |
sleep 0.005 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment