keyTyped key repeat with P3D backend

edited February 2018 in Questions about Code

Beginner question:

The behaviour of keyTyped appears to behave differently with different OpenGL vs default backends. In the example below, the code generated multiple keyTyped calls on holding down a key, but only with the default backed. As soon as I switch to P3D or P2D in the size() call, the key repeat stops working, and I only get one keyPressed and keyReleased pair.

The keys in question are UP and DOWN, the behaviour is analogous for letter keys. I have disabled ApplePressAndHoldEnabled previously

Is this an OpenGL issue? Should there be some additional setup for an openGL backend?

void setup() {
  size(200, 200, P3D); // Works with default, does not work with P2D or P3D
}

void draw() { }

void keyPressed() {
  println("pressed " + int(key) + " " + keyCode);
}

void keyTyped() {
  println("typed " + int(key) + " " + keyCode);
}

void keyReleased() {
  println("released " + int(key) + " " + keyCode);
}

OS: MacOS High Sierra (10.13.3) Version: Processing 3.3.6

Thanks!

Sign In or Register to comment.