I found a great little basic script for closing a running process. It's for an emulator front end which allows closure of a specific emulator and then return to the front end among other things.
But it is too basic and I need extra functionality. The script lets me press 1 joystick button to perform the action of killing a single process as shown below. BUT I need the script to press 2 joystick buttons at the same time to kill the process.