Pilot gamepad interrupt python script

I wrote a forms gui to enable flying to waypoints and waiting there until it’s time to fly to the next waypoint. However, now the pilot can’t take over, due to a TImer event function sending update commands. Any suggestions on how to detect pilot inputs over gamepad, possibly using Joystick.