0

We're all used to the media keys in the top row of an Apple keyboard to command iTunes, even when some other application is frontmost.

If I have VLC frontmost, those media keys don't control iTunes but work as "next / previous" in VLC, which is a rather annoying exception because not does it only make iTunes controlling unreachable, it's plain unnecessary because to navigate within the frontmost application, the norm is to use arrow keys, or cmd+arrow. How do I reserve the good old media keys for iTunes, always?

I'm on Yosemite.

1

You can use Karabiner-Elements to set the play/pause button (on my keyboard fn+F8) to always control iTunes from any App (I know Apps besides just VLC also commandeer the iTunes buttons sometimes).

Just add something like the following rule to ~/.config/karabiner/karabiner.json

{  
   "description": "Play/pause button should only control iTunes.",
   "manipulators": [  
      {  
         "from": {  
            "key_code": "f7",
            "modifiers": {  
               "mandatory": [  
                  "fn"
               ]
            }
         },
         "to": [  
            {  
               "shell_command": "osascript -e 'tell application "iTunes" to previous track'"
            }
         ],
         "type": "basic"
      },
      {  
         "from": {  
            "key_code": "f8",
            "modifiers": {  
               "mandatory": [  
                  "fn"
               ]
            }
         },
         "to": [  
            {  
               "shell_command": "osascript -e 'tell application "iTunes" to playpause'"
            }
         ],
         "type": "basic"
      },
      {  
         "from": {  
            "key_code": "f9",
            "modifiers": {  
               "mandatory": [  
                  "fn"
               ]
            }
         },
         "to": [  
            {  
               "shell_command": "osascript -e 'tell application "iTunes" to next track'"
            }
         ],
         "type": "basic"
      }
   ]
}

Get rid of the "modifiers" part if you normally press F8 without pressing fn to play/pause iTunes.

Then in Karabiner-Elements you'd add your new rule as a complex modification:

enter image description here

| improve this answer | |
  • The newest version appears to only be for Sierra and later. I'm on Yosemite 10.10.5. There appears to be a list of older versions there but I'm having trouble finding any info on operating system compatibility of the old versions. – user158589 Mar 29 '18 at 10:18
  • Yes, on Karabiner's Download page you can click the arrow next to the downloads button. There is an option for Karabiner-10.22.0 which works with Yosemite – theonlygusti Mar 29 '18 at 10:53
  • @user158589 any luck? – theonlygusti Mar 29 '18 at 22:55
0

You don't need a third party tool. VLC has an open source heritage and they are all about customizing your apps to suit your personal preferences.

Open VLC and go to VLC > Preferences > Hotkeys

You can change what VLC uses there.

Note that you will likely have to change what is already set by VLC to change to your preference.

On my Mac it would not let me select just F8 to change the keyboard shortcut for play/pause. I had to press fnF8 to use the F8 key as Play/Pause.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .