4

The research, the problems, the mid-age crisis

There are some questions here and there about capturing the play/pause events. The solution usually relies on extending NSApplication and capturing the sendEvent. However, there are two problems with that: The iTunes opens OR some apps capture it before (Spotify I am looking at you).

Damn you spotify

More people were bored with iTunes opening using the play/pause, and posted in the stackoverflow. However, the solution still gets beaten by spotify (and it relies on a strange whitelist). If I open the example and press one of the mediakeys spotify catches the event and that solution doesn't.

How can I defeat Spotify and capture media events?

Community
  • 1
  • 1
Tiago Almeida
  • 14,081
  • 3
  • 67
  • 82

1 Answers1

6

Actually the SPMediaKeyTap works as expected but with a small caveat:

You have to run it in release mode!!!

I have discovered that checking the VLC source code.

I hope this can save some time to other people.

PS: If you find a better solution than SPMediaKeyTap please post it here. So far this is the best solution I have found.

Tiago Almeida
  • 14,081
  • 3
  • 67
  • 82