More > JRiver Media Center 21 for Linux
Play/Pause with hotkey
mwillems:
--- Quote from: blgentry on March 22, 2016, 03:11:56 pm ---Well, not exactly as I think you're thinking of doing something like MC.exe /MCC 20001 right? The user defined keys are done inside of a Resource.xml file that specifically maps keys. Here's a portion of the one I use on MC for Mac:
--- Code: ---<!-- DSP Studio -->
<Entry Key="Ctrl;D" Command="10016" Param="0" />
<!-- Play/Pause -->
<Entry Key="Space" Command="10000" Param="0" TranslateFlags="21" />
<!-- Next and Previous track -->
<Entry Key="Ctrl;Right" Command="10003" Param="2" TranslateFlags="21" />
<Entry Key="Ctrl;Left" Command="10004" Param="2" TranslateFlags="21" />
<!-- Show Now Playing -->
<Entry Key="Ctrl;N" Command="10013" Param="1" />
--- End code ---
As you can see, they specifically use MCC command numbers, but it's called via the "entry key" commands and not through an MC.exe command line.
--- End quote ---
That's super neat, thanks for calling that to my attention. I just assumed that wouldn't work because the MCC command line wasn't supported.
--- Quote ---As I understand it, none of the keys that are mapped into MC (manually or built in) are functional unless the window is focused. If you want truly global key mappings, then I guess your solution of using MCWS and some kind of scripting and integration with the window manager is probably a better solution.
Brian.
--- End quote ---
I was assuming OP wanted global shortcuts as, if the window is focused, you can play or pause just by pressing the spacebar out of the box on all platforms. So I was (perhaps erroneously) assuming he was looking for something more like a media key on a keyboard that would work no matter what he was doing otherwise. He can fill us in on what he needs ;)
blgentry:
--- Quote from: mwillems on March 22, 2016, 09:05:00 pm ---That's super neat, thanks for calling that to my attention.
--- End quote ---
It's a good day when I can help you out. :)
--- Quote ---I was assuming OP wanted global shortcuts as, if the window is focused, you can play or pause just by pressing the spacebar out of the box on all platforms.
--- End quote ---
This is worth expounding upon, because it just bugged me like CRAZY when I first got MC running. Yes, spacebar does Play/Pause in MC. But not always. ...and it's not obvious why until you play around with it. Essentially, MC only does play/pause with spacebar when the focus is in the playing now pane, or in one of file display areas, or in a category. It will NOT do play/pause when you are focused on the navigation tree on the left, the search area, and perhaps a few others.
This promotes a very inconsistent interface experience, as you wonder, "why the hell isn't spacebar working?!??" Apparently spacebar can be used for navigation tasks too. Like expanding tree segments. This is stupid and should be changed. But it's not likely to be changed because it has history.
My key mapping above addresses this by overriding the default behavior of spacebar in almost all areas of MC's interface. *Except* for text entry boxes where you probably want to be able to type a space! Getting this working was really nice. After all, pretty much every audio player in existence uses spacebar for play/pause and it's generally not context sensitive, except for places where you'd want to type a literal space.
The key is the TranslateFlags parameter.
Brian.
mikeza:
Thanks a bunch guys. The intent was for global shortcuts, yes. I'll have to spend some time delving into the media server interface. I'll post back when I make some progress!
Navigation
[0] Message Index
[*] Previous page
Go to full version