Key Bindings with JOGL GLCanvas (java)

195 Views Asked by At

Just curious, how would you use key bindings with the openGL GLCanvas? I understand how to use them with JPanel (which applies to GLPanel) but is it possible to use it with GLCanvas? How would you do it if it is possible?

-Dan

1

There are 1 best solutions below

1
On BEST ANSWER

(OK, I just now looked up the GLCanvas API)
Q: What does GLCanvas extend?
A: Canvas, an AWT component.

Q: Does AWT have key bindings?
A: No. So the overall answer is you can't use Key Bindings directly with GLCanvas.

Perhaps it can be used indirectly by attaching the bindings to another Swing component in the same GUI.