Projets

test keyboard


PFont f;
String typing = "";

void setup(){
  size (600,600);
  smooth();
  f = createFont("Arial",16,true);
  textAlign(CENTER);
  textFont(f);
  }
  
void draw(){
  background(255);
  fill(0);
  text("Click to focus, then type. Click to clear.",width/2,20);
  text(typing,width/2,height/2);
  }

void keyPressed() {
    typing = typing + str(key);
}

void mousePressed() {
  typing = "";
}