Skip to content

Instantly share code, notes, and snippets.

@TylerOderkirk
Created July 21, 2015 02:46
Show Gist options
  • Save TylerOderkirk/228b745f3b1e7a97fe1d to your computer and use it in GitHub Desktop.
Save TylerOderkirk/228b745f3b1e7a97fe1d to your computer and use it in GitHub Desktop.
Switching tmux windows on ADS7846 touch events
#!/bin/bash
while :; do # until forever...
if ! evtest --query /dev/input/event2 EV_KEY BTN_TOUCH; then # if somebody is pressing their finger on the touchscreen...
echo BTN_TOUCH!
tmux next-window -t 0 # tell un-named tmux session #0 to switch to its next window
sleep .1s # avoid doing this twice for a single touch
fi
sleep .05s
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment