Login  Register

Re: key input Keylistener doesn't work for JOGL

Posted by tragic_xxx on Nov 08, 2017; 1:54pm
URL: https://forum.jogamp.org/key-input-Keylistener-doesn-t-work-for-JOGL-tp4038300p4038304.html

jmaasing wrote
tragic_xxx wrote
gouessej wrote
If the GLCanvas receives the key events, the key listener will have to be added to it instead of the JFrame, it's a basic Swing problem, it's not a JOGL problem.
How do I add the KeyListener to JFrame correctly (in this context)?
Swing works that way,...
https://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html
I am a noob with this, I stated so and asked some questions, but you didn't read everything:::

"Thank you for reply.  Can you elaborate further, I am rather new to these particular APIs. 
How do I add the KeyListener to JFrame correctly (in this context)?
I tried to use GLU.createGLU(GL) instead of GLU(), but I must have written the wrongly because I had errors. So  how do I replace GLU() correctly?
Is it possible that you write the corrections over the original code and paste it in a reply? I will learn better that way.

Many thanks in advance
"

... I mean for newbies like me, reading only the theory often adds to the complexity and mystery of the issue, if not accompanied by a slight code snippet (in this case code correction).  Very honestly I am still lost as I got errors from my attempts to correct it

Is it possible that you write the corrections over the original code and paste it in a reply? As a newbie, I will learn better that way.

With regards and many thanks, all help appreciated