How can you block the key "Escape"

Hi,
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.

2 Likes

Thank you so much:grinning: