Como bloquear um retângulo de sair da tela P5

if ((keyIsPressed == true) && ((key == 'a') || (key == 'A'))) {
Smiling Sloth