How can you block the key "Escape"

does somebody know how to block processing from closing the sketch when you press escape?

I tried this but it did not work:

void draw(){
if(key == ESC)key = 0;

Thank you

1 Like

Hi! That code should be inside void keyPressed(), not inside void draw(). Then it works.


Thank you so much:grinning: