How do you detect / stop someone from closing the sketch?

I want to have some code run before the sketch is closed, but I don’t know how to detect when the window itself has been closed by clicking its x. I’d also be okay with making the window borderless, but I can’t find a way to do that either. If nothing else works, I could just have it always be fullscreened, but I’d like to have it be windowed too. If anyone knows how to detect closing / make it borderless, please let me know.

Edit: hold on, I think I might have it

1 Like
2 Likes

That worked! Thank you so much!

1 Like