Interface 9
Sun Jan 07 2024 18:29:30 GMT+0000 (Coordinated Universal Time)
Saved by
@马丽
PFont customFont;
void setup() {
size(400, 400);
background(220);
// Load a font that includes the necessary characters
customFont = createFont("Arial", 32);
textFont(customFont);
}
void draw() {
// This function is intentionally left empty
}
void keyPressed() {
// Display the key that was pressed on the background
background(220); // Clear the previous content on the background
textSize(32); // Set the text size
fill(0); // Set the text color to black
text("Key Pressed: " + key, 50, 50); // Display the key value on the canvas
}
content_copyCOPY
Comments