I tried to use dxhd with xdotool to prepend each key with Ctrl+G, then type that key, and hit another key, like so
#!/bin/sh
# @{a-z}
xdotool key ctrl+g
xdotool type {a-z}
sleep 1
xdotool key Tab
What I'm trying to accomplish is when I type any character, a for example, it will act as if I hit Ctrl+G, then type an a, and wait for 1 second, and then hit Tab.
The problem is when I try to type a, it would actually send Ctrl+G, then an a, which would trigger another sequence recursively (another Ctrl+G -> a -> Ctrl+G -> a -> ...).
Is there a correct way of doing this?