Stop VLC from capturing Mac keyboard media keys

macOS specific usage questions
Gary King
Blank Cone
Blank Cone
Posts: 54
Joined: 01 Nov 2004 01:41

Stop VLC from capturing Mac keyboard media keys

Postby Gary King » 02 May 2015 07:28

I've got a Mac keyboard with media keys. I use them to control Spotify, rather than iTunes. When VLC is in focus, though, it captures the media keys, and therefore hitting the Play/Pause key while VLC is in focus does nothing, since VLC itself doesn't respond to media keys unless they are intentionally set, which I did not do. So VLC is just capturing the keys but doing nothing with them.

Is it possible to prevent VLC from capturing the keys so I can still use the media keys to control Spotify when VLC is in focus?

Thanks in advance!

wizbang2fl
New Cone
New Cone
Posts: 7
Joined: 02 May 2015 04:45

Re: Stop VLC from capturing Mac keyboard media keys

Postby wizbang2fl » 02 May 2015 08:42

In order for VLC to pass the request you would need to have the system keyboard preference not marked to use the F keys as standard Function Keys. (box unchecked) and in VLC also have the "control playback with media keys" unchecked.

I tried this on my OS X 10.10.3 and with these settings iTunes 12.1.2.27 opens. Unless you have a program that already cross references the keys when using other programs (like pages, numbers, etc) I would think it's a feature request.

Of note: I have run across a issue where a number of preferences in VLC are not being retained once the program is closed and relaunched. So if you are experiencing this behavior you will need to set the preference after opening VLC until a resolution is obtained or bug fix is deployed.

Hope that helps,

dfuhrmann
Developer
Developer
Posts: 1183
Joined: 02 Jul 2012 11:09

Re: Stop VLC from capturing Mac keyboard media keys

Postby dfuhrmann » 02 May 2015 09:14

I've got a Mac keyboard with media keys. I use them to control Spotify, rather than iTunes. When VLC is in focus, though, it captures the media keys, and therefore hitting the Play/Pause key while VLC is in focus does nothing, since VLC itself doesn't respond to media keys unless they are intentionally set, which I did not do. So VLC is just capturing the keys but doing nothing with them.
VLC captures the keys if you have a playlist with at least one item (also if a video / audio is playing). In this case, of course VLC also reacts on key press events, so it's wrong that there is no functionality behind it.

If you do not like this behaviour, you can easily disable it in preferences, and then VLC will ignore the media keys entirely.

Gary King
Blank Cone
Blank Cone
Posts: 54
Joined: 01 Nov 2004 01:41

Re: Stop VLC from capturing Mac keyboard media keys

Postby Gary King » 02 May 2015 17:22

  • I already have "Control playback with media keys" unchecked. Is there any other setting I should check?
  • And, VLC captures my media keys even with 0 items in its playlist (like when starting up the app).
  • And I already have F keys setup like special Mac keys rather than normal function keys.
  • Preferences are otherwise saving fine for me.

Gary King
Blank Cone
Blank Cone
Posts: 54
Joined: 01 Nov 2004 01:41

Re: Stop VLC from capturing Mac keyboard media keys

Postby Gary King » 08 May 2015 05:31

Also, I'm not using the standard Apple Mac keyboard. I'm using the Logitech K750 instead. I noticed, for instance, that the media keys on this keyboard work fine in iTunes, but only the Play/Pause one worked in Spotify, while Previous/Next keys did not work in Spotify.

So could the fact that I'm not using the standard Apple Mac keyboard also affect how it interacts with VLC?

fkuehne
Developer
Developer
Posts: 7241
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: Stop VLC from capturing Mac keyboard media keys

Postby fkuehne » 08 May 2015 11:33

We are using the same code as Spotify to capture the media keys with a small bug fix which allows us to use Previous/Next keys on 3rd party keyboards which was never done in Spotify (no idea why, it's a trivial 3 lines of code change). The reason why we are sharing the code with Spotify is that if Spotify is in the foreground, the controls will work for it while VLC is running in the background and the other way around.

Disabling the option you found should actually be enough to stop VLC from listening to those key events, just make sure to restart VLC after switching the state. Are you using the latest version of VLC for the Mac? (that's 2.2.1 right now)
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

Gary King
Blank Cone
Blank Cone
Posts: 54
Joined: 01 Nov 2004 01:41

Re: Stop VLC from capturing Mac keyboard media keys

Postby Gary King » 08 May 2015 19:40

Yep using VLC 2.2.1 on Mac. Already restarted VLC multiple times.


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 20 guests