with P2D renderer `key` variable doesnt update when pressing CTRL and another key
Description
When using the P2D renderer the key variable doesn't update when pressing control and then another key.
Expected Behavior
Pressing control and then another key should set the key variable to CODED (65535) and then whatever other key you pressed.
Current Behavior
Pressing control and then another key doesn't update the key variable and it ends up containing CODED for both key presses and any subsequent key presses.
Steps to Reproduce
- Set renderer to P2D
- Create a keyPressed function that prints out the
keyvariable - Press control and then another key
Your Environment
- Processing version: 4.3 (latest)
- Operating System and OS version: Windows 10 Pro 22H2
Possible Causes / Solutions
OpenGL renderer isn't updating key variable when it should be.
Are you pressing both the keys CTRL and (any other key) simultaneously? As in CTRL+<key>? Or CTRL then <key> ?
Also in-case this helps, key should contain CODED and if you want to get the value of the key, use keyCode instead of key.
// using P2D
void keyPressed() {
if (key == CODED) {
println((char)keyCode);
}
}