mdqinc / SDL_GameControllerDB

A community sourced database of game controller mappings to be used with SDL2 Game Controller functionality
http://libsdl.org
zlib License
1.38k stars 520 forks source link

How to determine Button Layout? #802

Closed snackbean closed 3 weeks ago

snackbean commented 3 weeks ago

The mapping guide indicates how non-xbox/playstation controllers should be mapped. However, from gamecontrollerdb.txt alone, there is no way to determine which mapping was used. In other words: how do you tell what type of gamepad it is? This is critical information for various reasons:

By the way, readme should really indicate the mapping for xbox/playstation style controllers, N64 controllers, NES controllers, and what Gamecube L/R/Z and Sega Mode buttons should be mapped as. I am happy to contribute some images here in the same style, but I don't know what font the image uses.

offalynne commented 3 weeks ago

This is a community database. If you have issues with SDL, take them up with SDL: https://github.com/libsdl-org/SDL

from gamecontrollerdb.txt alone, there is no way to determine which mapping was used

Correct

how do you tell what type of gamepad it is

https://wiki.libsdl.org/SDL2/SDL_GameControllerGetType

confirm/cancel button depends on the controller type and region

This is irrelevant to the mapping db

By the way, readme should really indicate the mapping for xbox/playstation style controllers, N64 controllers, NES controllers, and what Gamecube L/R/Z and Sega Mode

You already linked what you asked for? https://github.com/mdqinc/SDL_GameControllerDB?tab=readme-ov-file#mapping-guide. PlayStation, NES, N64, other self evident mappings are intentionally omitted.

snackbean commented 3 weeks ago

I'll have to check the SDL source code, as I'm not sure how it figures out the game controller type. (I notice that the Sega layout is not one of them.)

NES and xbox/playstation may be fairly obvious, but N64 and Gamecube are not obvious to me. Should L be mapped to L1 or L2 for instance, and Z to R1 or R2? Are the A,B,C1-4 buttons on the N64 mapped like the sega controller?

(Edit: I mean leftshoulder and lefttrigger instead of L1 and L2, etc.)

offalynne commented 3 weeks ago

I'll have to check the SDL source code

OK

Gamecube

Use the README. You already linked the explanatory image, which includes very clear instructions.

Should L be mapped to L1 or L2 for instance, and Z to R1 or R2

SDL mappings contain no L1 or R2. I don't know how to better explain to you what leftshoulder and righttrigger mean outside the dictionary definitions of these words. If you have an actual contribution to make, and would like to include a photo or link of the device in question I can tell you how the mapping should be authored. Otherwise, please review the README again for whatever you are trying to accomplish.

snackbean commented 3 weeks ago

By the way, here's some past discussion of this issue, and this repo seems to be the Schelling point for where this information ought to be stored:

offalynne commented 3 weeks ago

this repo seems to be the Schelling point for where this information ought to be stored

No. This is a db of gamepad mappings for SDL, nothing more or less. Take your issues up with SDL or the project you linked.

snackbean commented 3 weeks ago

Gamecube

L, R, Z are not part of the explanatory image. I would assume that Z should be mapped to rightshoulder, L to lefttrigger, and R to righttrigger. What's confusing here though is that the pro controller, also by Nintendo, calls the left shoulder button L instead, and I believe that emudeck goes along with this as its default dolphin configuration. So it seems there's some need for clarification I'd say.

Here are photos of the device.

offalynne commented 3 weeks ago

I would assume [..]

Correct

[other projects]

This repository has nothing to do with EmuDeck, or Dolphin, this is a DB for SDL gamepad mappings. We do not care whatever is happening downstream. Take your issues up with those projects.

Here are photos of the device.

This is not what I meant. If you have data to contribute to this database, feel free to open an issue sharing your work demonstrating a useful contribution, then explain whatever remains unclear to you.