jogamp
›
jogl
Search
everywhere
only in this topic
Advanced Search
Is it possible to have the list of down keys?
Classic
List
Threaded
♦
♦
Locked
5 messages
elect
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Is it possible to have the list of down keys?
I see the KeyEvent has a nice getButtonDownCount() and getButtonsDown() but these refer to mouse buttons..
isn't there a way to get the corresponding list of pressed keyboard buttons?
Art
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Is it possible to have the list of down keys?
You can check out what I did in an open source library here:
https://bintray.com/pnnl/maven/svf/view
The relevant code is under gov.pnnl.svf.*.input in svf, svf-awt, and svf-swt.
It essentially just tracks the state of key presses for the view.
elect
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Is it possible to have the list of down keys?
Could you point me to something more precise?
Art
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Is it possible to have the list of down keys?
Are you running JOGL in Swing, SWT, NEWT, or JavaFX?
Art
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Is it possible to have the list of down keys?
Here's the code for the Swing implementation. You just need to add it as key and focus listeners to the Swing panel.
https://github.com/pnnl/svf/blob/master/svf-awt/src/main/java/gov/pnnl/svf/awt/input/AwtInputKeyAdapter.java
Free forum by Nabble
Edit this page