You need to set up a Global variable and monitor it in the loop and Monitor the keypresses for the combination you want and set the variable if they are pressed.
If it's a long running process then it will also lock the gui, you may need to run it on a different thread or add a sleep statement. It really depends on what it's doing.