How to emulate pressing media keys in Java?
问题 How can I emulate pressing media keys in Java? Such as play/pause, next/previous, volume control. C# has VK_MEDIA_PLAY_PAUSE , VK_MEDIA_NEXT_TRACK and so on. Java has class Robot for working with keys, but there are no media keys. 回答1: I used the JNI Library to simulate the key presses using code written in C. I've created a .dll file and .java file for hitting the "Volume Down", "Volume Up", "Volume Mute", "Previous Track", "Next Track", and "Play/Pause Track" media keys. Here is a link to