How do I control Plex HTPC/Media Player with a Switch Pro controller?

Server Version: 4.59.2
Player Version: 2.58.0.1076-38e019da

Hey, I want to conltrol my Plex HTPC with my Nintendo Switch Pro Controller. I tried to follow this article (Create your own inputmap | Plex Support) but it seems like it doesn’t work with HTPC so I tried it with the old Windows Plex Media Player. I found the controller id in the log file and created a json file as described. But when I press any button on my controller and close the player I can’t find any input log in the log file.

The log file part with the controller id:

2021-08-24 21:30:34 [ INFO  ] InputSDL.cpp @ 207 - SDL found  1  joysticks 
2021-08-24 21:30:34 [ INFO  ] InputSDL.cpp @ 216 - JoyStick # 0  is  Microsoft-PC-Joysticktreiber  with  16  buttons and  4 axes 

My json file:

{
  "name": "Switch Pro Controller",
  "idmatcher": "Microsoft.*",
  "mapping": 
  {
      "BUTTON_NAME_HERE": "function here",
      //Here you can write comments
      "BUTTON_NAME_HERE": "function here",
      //Here you can write comments
      "BUTTON_NAME_HERE": "function here",
      //Here you can write comments
      "BUTTON_NAME_HERE": "function here",
      //Here you can write comments
      "BUTTON_NAME_HERE": "function here",
      //Here you can write comments
      "BUTTON_NAME_HERE": "function here",
      //Here you can write comments
  }
}

What am I doing wrong? The controller works fine with steam btw.

Instead of the placeholders "BUTTON_NAME_HERE": "function here", you must put in actual buttons and functions.

The first thing I need to do is find out what each button is called. According to the instructions, the best way to do this is to press the buttons and write down the commands.

  1. Launch Plex Media Player and wait for it to finish loading
  2. Press the desired button on your remote/controller
  3. Look in the Plex Media Player.log file to see the button information

For instance, in the below log snippet, the PlayStation 3 controller was used. The X button was pressed first, then two seconds later the Square button was pressed.

2016-01-20 13:33:38 [ DEBUG ] InputComponent.cpp @ 86 - Input received: source: "PLAYSTATION(R)3 Controller" keycode: "KEY_BUTTON_14"
2016-01-20 13:33:40 [ DEBUG ] InputComponent.cpp @ 86 - Input received: source: > "PLAYSTATION(R)3 Controller" keycode: "KEY_BUTTON_15"

From the log, we see that:

  • X corresponds to KEY_BUTTON_14
  • Square corresponds to KEY_BUTTON_15

With that information, you can then go to your skeleton inputmap file and change out the text BUTTON_NAME_HERE to read KEY_BUTTON_14 (or whatever button name you saw in the logs) instead. Repeat the process for other buttons.

My problem is that I don’t get those “Input received” log lines.

Correct. That is the way to find out the name of the buttons on your controller.

For a hint about the possible commands, you can take a look into the prefabricated json files in the \inputmaps\examples folder.

You may also find this of interest: An on-demand audio dynamics compressor for PMP and Plex HTPC

It looks like the player ignores the controller despite the idmatcher and does not accept any input commands, which is why I cannot read the input commands from the log file.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.