简体   繁体   中英

Key Bindings with JOGL GLCanvas (java)

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM