So I have an auto clicker script that is this simple command: Tributexdotool click --delay 5 --repeat 900000 1I have to switch to the terminal and Ctrl-C interrupt the script to stop it. Then just run it again to restart. So I started to use the read command to check for key input to avoid this switching back and forth. However that only checks for input at the terminal. I am clicking somewhere else, and want to be able to start and stop from there.Is there a version of read that can check for keystrokes globally?
How to make an auto clicker with global start and stop key
bash;read
Bit late here, but here is a solution.By typing xinput --list, you get a list of all the input devices in your system. The trick is with xinput --query-state. If you go into terminal and you list the inputs, you can then do xinput --query-state [YourKeyboard].1 class :KeyClass    key[0]=up    key[1]=up    key[2]=up...Now, you will need to hold down the key, so you can eitherUse > to write to a file, letting you hold down the key when you execute the commandMake a quick bash scriptwhile true; doxinput --query-state [YourKeyboard] | grep 'down'done# StackExchange does not like bashEDIT: I am not on Linux right now, so I cannot try this, but I heard you can use xinput --test as wellOnce you find the correct key, make a script like this.#!/bin/bashwhile true; doinp=`xinput --query-state <KEYBOARD#ID> | grep -o 'button\[<KEYBOARD#BUTTON>\]=down'`if [ ! -z $inp ]; thenxdotool click 1fidoneThis will spam click the mouse button while the user holds down a button