Re: addKeyListener cannot be added to GLAutoDrawable
Posted by Mohara on Apr 02, 2012; 4:48pm
URL: https://forum.jogamp.org/addKeyListener-cannot-be-added-to-GLAutoDrawable-tp3875604p3878256.html
Weirdly enough, I couldn`t get the program to answer the keys if I added the key listeners to the GLCanvas. Even more surprising is the fact that I added it to the Jframe. I managed somehow. Thank you.
I am still curious about how the tutorial has GLAutoDrawable.addKeyListener() , while I couldn`t make it work. Since I am learning I wanted to know the right way. Adding to the GLCanvas or even JFrame destroys the hierarchy I planned, so I rather add it somewhere in the Renderer.class and the only Component (at least following the Javadocs) should be GLAutoDrawable.