This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Gamepad Database Tentative Design

This is a tentative design for a simple gamepad database, containing both SDL2 mappings of gamepads and layout descriptions.

The database is a keyfile containing 3 kind of groups:

To use it, compute your gamepad's SDL2 GUID, and lookup the corresponding group. If there is one, check the corresponding gamepad list, and from the gamepad check the corresponding layouts.

[030000004c0500006802000011010000]
Gamepads=030000004c0500006802000011010000;

[0000000058626f782047616d65706100]
Gamepads=0000000058626f782047616d65706100;

[Gamepad 030000004c0500006802000011010000]
Name=PS3 Controller
DisplayName=PlayStation 3 Controller
DisplayName[fr_FR]=Manette PlayStation 3
StandardMapping=a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,
Layout=PS3

[Gamepad 0000000058626f782047616d65706100]
Name=Xbox Gamepad (userspace driver)
DisplayName=Xbox Controller
DisplayName[fr_FR]=Manette Xbox
StandardMapping=a:b0,b:b1,x:b2,y:b3,start:b7,back:b6,guide:b8,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,lefttrigger:a5,righttrigger:a4,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a2,righty:a3,
Layout=Xbox

[Layout PS3]
A=⨯
AColor=#7CB2E8
B=○
BColor=#FF6666
X=□
XColor=#FF69F8
Y=△
YColor=#40E2A0
L=L1
R=R1
L2=L2
R2=R2
L3=L3
R3=R3
Start=Start
Back=Select
Guide=PS

[Layout Xbox]
A=A
B=B
X=X
Y=Y
L=LB
R=RB
L2=LT
R2=RT
L3=Left Stick
L3[fr_FR]=Stick gauche
R3=Right Stick
R3[fr_FR]=Stick droit
Start=Start
Back=Back
Guide=Guide

Discussion and Ideas


2024-10-23 11:03