how to trap the directional arrows and other special keys

edited June 2015 in How To...

when trapped as a char, the directional arrows, page up or down, return a question mark. when trapped as an int, the arrows always return 65535

how can the directional arrows and special keys be recognized?

void setup(){
  size (200,200);

void draw(){


void keyPressed(){
  char x = key;
  int y = int(key);
println ("key = " + x);
println ( "key value = " + y);
Sign In or Register to comment.