Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
45 posts
|
Is there any way to listen multimedia keyevents in newt, since it listens native keys
I am working on app which needs multimedia remote keys to work. so far the solution that seems to work is https://github.com/kwhat/jnativehook Will the solution I mentioned interfere with newtkeyevents? LWGJL seems to have media key events (although i have not tested it) https://github.com/LWJGL/lwjgl/blob/master/src/java/org/lwjgl/opengl/WindowsKeycodes.java |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
6043 posts
|
Hey
What is missing in KeyEvent to support what you're looking for? What happens when you press "pause", "next track" or "previous track" in a program using NEWT?
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
45 posts
|
This post was updated on Mar 09, 2018; 10:11am.
for all multimedia keys , KeyCode returned is 0
BTW keypressed is fired for multimedia events, but of no use since we do not know which key was pressed this is sample program which displays keycode and keychar in console window /** * A program to listen newt keyevents * */ public class JOGL2NewtDemo { private static String TITLE = "JOGL 2 with NEWT"; // window's title private static final int WINDOW_WIDTH = 400; // width of the drawable private static final int WINDOW_HEIGHT = 300; // height of the drawable private static final int FPS = 60; // animator's target frames per second /** * The entry main() method. */ public static void main(String[] args) { // Get the default OpenGL profile, reflecting the best for your running platform GLProfile glp = GLProfile.getDefault(); // Specifies a set of OpenGL capabilities, based on your profile. GLCapabilities caps = new GLCapabilities(glp); // Create the OpenGL rendering canvas GLWindow window = GLWindow.create(caps); // Create a animator that drives canvas' display() at the specified FPS. final FPSAnimator animator = new FPSAnimator(window, FPS, true); window.addWindowListener(new WindowAdapter() { @Override public void windowDestroyNotify(WindowEvent arg0) { // Use a dedicate thread to run the stop() to ensure that the // animator stops before program exits. new Thread() { @Override public void run() { if (animator.isStarted()) animator.stop(); // stop the animator loop System.exit(0); } }.start(); } }); window.addKeyListener(new KeyListener(){ @Override public void keyPressed(KeyEvent e) { System.out.println("keycode="+e.getKeyCode()+" keyChar="+e.getKeyChar()); } @Override public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub } }); window.setSize(WINDOW_WIDTH, WINDOW_HEIGHT); window.setTitle(TITLE); window.setVisible(true); animator.start(); // start the animator loop } } |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
6043 posts
|
Thank you. Please fill a bug report (request for enhancement). It will be scheduled for JOGL 2.4 (probably not for JOGL 2.3.3).
Julien Gouesse | Personal blog | Website
|
Free forum by Nabble | Edit this page |