I was considering doing something like that before, but if the frame rate of the program is low, it might not check often enough.
I was looking for a solution just like the p5.js event, but since there doesn’t seem to be one, I’ll probably use it.
Thanks!