Nintendo NES joycon does not recognize select

I recently got the Nintendo NES joycon controllers. All the buttons work, except for the select button. It does get recognized in the windows controller setup window and in programs such as joytokey, which recognize it as button 9 (Left thumbstick click).

Is there any way to fix this? My project is set to OpenGL and running on Windows.

Have you used DS4Windows?

Replica / Copy Cat Controllers

If a gamepad is made to be a complete replica of a official one, meaning that they act exactly as the original controller and appear to Windows as such, then chances are DS4Windows will just detect it as being the official controller and it may just work. For example, 8bitdo controllers that are compatible with Nitendo’s Switch usually present themselves as a replica of the Pro Controller and can be used as normal with DS4Windows.

I used this to get the PS4 pads to function, check the compatibility list if that pad is on there.

DS4 Controller | Supported Gamepads (ds4-windows.com)

1 Like

Doesn’t look like the NES controller is supported by this program. I just find it strange the controller works without any external tools, just not the select button

MonoGame uses the SDL Game Controller DB.

This could just be a situation where either that controller isn’t fully mapped in db, or the db has been updated but the version used in the monogame release hasnt.

Steam also uses the SDL DB for big picture mode. Can you check if the select button is recognized there? If so that might confirm what i mentioned above.

1 Like

It works correctly in steam big picture. It actually maps it to the select button instead of the left stick, so the db not being updated sounds like it’s the most likely case

Did you assign the JoyCon to it in DS4?

I turned on joycon support, but it just connects and a second later disconnects again.

That’s interesting… did you try what Aris suggested?

@PixieCatSupreme after doing some digging and asking around, can you try this and see if it resolves your issue

First download the curernt gamecontrollerdb.txt mapping file from this repo

Next, add the txt file in the root of your project folder (the folder with the .csproj).

Then in your .csproj file add the following so that the txt file is copied on build to the output

<ItemGroup>
    <Include None="gamecontrollerdb.txt" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
1 Like

I tried this and it doesn’t seem to work, at least not in MonoGame 3.8.1

Did you add it to the end of the file or in the matching group?

@PixieCatSupreme Hi, I’m back with maybe a solution for you (sorry for the delay).

Can you try the following and see if this resolves for you?

1. Create Custom Mapping Loader

The first step is to create a helper class you can use to load custom mappings. Add a new class to your project (for the purposes of example, i called it CustomControllerMapping but you can call it whatever you want)

(also replace YourNameSpace in the code below with your project’s namespace)

using System.Runtime.InteropServices;

namespace YourNamespace;

public static class CustomControllerMapping
{

    [DllImport("SDL2.dll", CallingConvention = CallingConvention.Cdecl)]
    public static extern int SDL_GameControllerAddMapping(string mappingString);
}

Next, in your Game1 constructor, add the following code (we’ll replace the string parameter in just a moment)

CustomControllerMapping.SDL_GameControllerAddMapping("");

2. Create Controller Mapping

Next you’ll need to create a full SDL controller mapping for your controller. To do this, you can use the SDL2 Gamepad Tool program found at https://www.generalarcade.com/gamepadtool/.

Download this tool, unzip it and run it. Then click the **Create A New Mapping" button

Follow all of the steps to create the mapping for each input button. If there is a button that your controller doesn’t have a 1:1 mapping for in the image, you can press the Skip button. Once you have completed all buttons mappings, click the Copy Mapping String button

Now go back to your game Game1 constructor and paste the mapping string you just copied as the parameter for the method we added. It should be something similar to this (your mapping string will be different than my example obviously)

CustomControllerMapping.SDL_GameControllerAddMapping("030000006f0e00008401000000010000,Faceoff Deluxe+ Audio Wired Controller for Nintendo Switch,platform:Mac OS X,a:b1,b:b2,x:b0,y:b3,back:b8,guide:b13,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,-leftx:a0,+leftx:a1,lefty:+a1,-rightx:a2,+rightx:a3,righty:+a3,lefttrigger:b6,righttrigger:b7,");

3. Run The Game

Now run the game and see if the buttons are all correctly mapped.

4. Caveat and Gotchas

  1. First, this code will only work for Monogame Crossplatform Desktop (DesktopGL aka OpenGL) projects, as they are the only ones that use SDL for the controller mapping.

  2. Second, the [DllImport] attribute that is part of the SDL_GameControllerAddMapping method will only work on Windows. This is because on Windows, OpenGL projects use the SDL2.dll where Mac uses libSDL2.dylib and Linux uses libSDL2-2.0.so.0. So if you want this as a single solution for all platforms you export to you’ll need to make use of #if preprocessor directives to specify the platform and which of those to import based on the operating system as well as ensuring those preprocessor values are set for your project. For example:

#if WINDOWS
    [DllImport("SDL2.dll", CallingConvention = CallingConvention.Cdecl)]
#elif MAC
    [DllImport("libSDL2.dylib", CallingConvention = CallingConvention.Cdecl)]
#else // Linux presumed if not windows or mac
    [DllImport("libSDL2-2.0.so.0", CallingConvention = CallingConvention.Cdecl)]
#endif
    public static extern int SDL_GameControllerAddMapping(string mappingString);
  1. Hardcoding the mapping string like in the example is not a great solution, especially if you want your players to be able to add their own mappings for their controller’s if needed. So I would recommend a solution where you add the mappings to a file and read them from the file to the game. Alternatively, you can just download the most current gamecontrollerdb.txt file from the SDL_GameControllerDB Github and read in all the mappings and add them manually (atleast until the next MonoGame release where the mappings will be updated).