2

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

Code Doggo
  • 2,146
  • 6
  • 33
  • 58

1 Answers1

3

(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.

Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
  • Thank for your answer. I just looked at GLCanvas and it escaped me to look at AWT. I think I might just have a GLPanel thrown onto the GLCanvas. So your indirect mention gave me that idea, thanks :) – Code Doggo Sep 17 '13 at 22:24