media keyboard

R

rmacnak

How do I receive input for pressing of the Play, Stop, Next, etc
buttons on my keyboard? (They don't seem to be in
java.awt.event.KeyEvent).

Thanks,
Ryan
 
M

Manish Pandit

How do I receive input for pressing of the Play, Stop, Next, etc
buttons on my keyboard? (They don't seem to be in
java.awt.event.KeyEvent).

Thanks,
Ryan

IMO, these buttons are non-standard - hence not supported by java.

-cheers,
Manish
 
A

Andrew Thompson

How do I receive input for pressing of the Play, Stop, Next, etc
buttons on my keyboard? (They don't seem to be in
java.awt.event.KeyEvent).

This simple source indicates there is no keyboard
event sent for the play/stop/next/previous keys of my
'Genius'* media aware keyboard.

* (shrugs vaguely) I think they are out of Taiwan,
it was $25 at Woolies.

<sscce>
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class ListenType extends JFrame implements KeyListener {

ListenType() {
setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
setSize(400,400);
JTextArea lbl = new JTextArea("Hi!");
lbl.addKeyListener(this);
getContentPane().add( lbl );
}

public static void main(String[] args) {
ListenType lt = new ListenType();
lt.setVisible(true);
}

public void keyReleased(KeyEvent ke) {}

public void keyPressed(KeyEvent ke) {}

public void keyTyped(KeyEvent ke) {
System.out.println( ke.toString() );
}
}
</sscce>

...so - JNI?

Andrew T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top