0

Or how do I send the same commands?

I want my app to be able to play/pause/etc. the currently-playing media in a desktop environment (Windows / macOS / Linux), but looking through the keys that Robot can press, these aren't there.

I looked briefly at jintellitype, but that doesn't seem to be what I want (something about running an Apache server?)

Is there any way to press these media keys or send similar commands to the OS using Java*? This can be anything in Java SE (AWT/Swing/FX/etc.) or some other free library.


* I'm actually using Kotlin, in case that helps

Ky -
  • 30,724
  • 51
  • 192
  • 308
  • 1
    This is kind of a bear in native code I very much doubt there is a pure Java solution. – pvg Feb 17 '17 at 23:45
  • @pvg I'm hoping there's some library out there that utilizes Java's `native` to do this, but thanks for the heads-up – Ky - Feb 17 '17 at 23:46
  • 1
    There might be but I think that's unlikely as well. Google around a bit for the native solutions to get an idea what a dark night full of horrors that stuff is. You can cheat a little though, for instance, on OS X, you can control itunes with applescript quite easily, etc. – pvg Feb 17 '17 at 23:51
  • @pvg Oh man that's promising for macOS! – Ky - Feb 17 '17 at 23:52

0 Answers0