You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
villares edited this page May 24, 2020
·
4 revisions
Nome
key
Exemplos
// Clique na janela para lhe dar foco e // pressiona a tecla 'B'voiddraw() {
if(keyPressed) {
if (key=='b'||key=='B') {
fill(0);
}
} else {
fill(255);
}
rect(25, 25, 50, 50);
}
Descrição
A variável de sistema key
sempre contém o valor da tecla pressionada mais recentemente no
teclado. Para se detetar as teclas de direcionamento, é
atribuído à variável keyCode um dos valores entre UP, DOWN, LEFT, ou RIGHT.