Replicating Alt_Tab behavior with other applications

I've been googling but can't find anything on this topic.

There's an application I want to launch when I press a key combination, but I also want it to run only whilst those keys are held down, then when the keys are released I want the application to quit (or goto a background process).

Is this possible by using key-bindings in gnome, perhaps Xorg? Or would the application have to be altered to run in an infinite loop, only running if those keys are held? Or would a service/daemon have to be created listening for that combination and then handle the launch/quitting?

The closest example I can think of is any application switcher that uses Alt+Tab.

Thanks
 
Back
Top