Hm.
when you want to stick with your approach: It’s a good program.
just add the state variable where you check the mouse