sojamo / controlp5

A gui library for processing.org
GNU Lesser General Public License v2.1
490 stars 142 forks source link

ControlP5 and P3D renderer weirdness #61

Closed Asendre closed 8 years ago

Asendre commented 8 years ago

Hello!

I'm currently working on a project that requires me to use ControlP5 along with the P3D renderer, and I'm having a few issues thus far:

If anyone has any ideas on how to fix these issues (or on how to "hack" controlP5 into behaving as if it was in Java2D mode), that would be greatly appreciated (sorry if I'm not supposed to be asking for help here).

sojamo commented 8 years ago

hi, not sure if I have a solution to the problems encountered, but some feedback. I am using osx, processing 3.0.2 and controlP5 2.2.5 (keyboard is set to english, U.S.). regarding issue reject: x^2 for example works for me for both renderers (shift+6), what seems odd though is, that in P3D the keyInput does not recognise letters assigned to keys pressed in combination with alt/option.

In the following example, alt+2 for example prints ™ into the console when using the default renderer, running the sketch with the P3D renderer though results in 2 hence seems to ignore alt. That might explain issue reject where alt/option combinations do not return the expected output.

void setup() {
  size(400,400);  
}

void draw() {
  background(200);
}

void keyPressed() {
  println("pressed",key,keyCode,frameCount);
}

regarding issue hold-key: holding down a key results in only 1 letter at a time for both, the default renderer as well as the P3D renderer for the above mentioned setup and example. since controlP5 receives keyEvents from Processing's key handler, the same behaviour applies to a textfield.

Asendre commented 8 years ago

Sweet, that's extremely helpful. I'll do some research on why the alt key behaves strangely in P3D mode, and I'll reply here if I find anything. The hold-key issue is not nearly as problematic as the first one, so I suppose I can let that one go, too. Thanks a lot for the help!