Is it possible to bind a (global) key press to some command and still not disrupt the key press from completing? What I mean is, if I try the bindkey solution posted elsewhere here:
# In file: ~/.xbindkeysrc
# Bind key 'q' to running 'some_command'
"some_command"
q
then the key press 'q' never completes as it otherwise would do: i.e., never prints the character 'q' on the terminal, for example.
Using xdotool to send a 'q' key press like this:
# In file: ~/.xbindkeysrc
# Bind key 'q' to running 'some_command'
"some_command && xdotool key q"
q
results in loop since the 'q' key press executed by xdotool will execute another 'some_command' via the binding.
To be a little clearer, I want the key press 'q' to execute as it normally does and in addition execute some external command. The solution above replaces the 'q' key press event with executing some external command. The problem is that if that external command also simulates a 'q' key press, then the binding re-launches the external command and I get stuck in an infinite loop.