il faut que tu relances sdl2-jstest -e 0 de nouveau et que tu notes le numéro des boutons quand tu appuies dessus
tu devrais voir ce type d'informations, exemple :
Si tu appuis sur le bouton B et que tu relaches tu as deux lignes qui apparaient :
SDL_JOYBUTTONDOWN: joystick: 0 button: 1 state: 1 code:289
SDL_JOYBUTTONUP: joystick: 0 button: 1 state: 0 code:289
1ére ligne : bouton appuyé
2ème ligne : bouton relaché
Button : 1 indique le numéro de ton bouton , cest ce que nous avons besoin de savoir
il faut le faire pour chaque bouton de ton pad suis ce schema :
A B X Y L1 R1 L2 R2 L3 R3
START SELECT
PUIS DPAD HAUT GAUCHE
PUIS JOYSTICK GAUCHE HAUT GAUCHE
PUIS JOYSTICK DROITE HAUT GAUCHE
Tu verras un truc du genre :
SDL_JOYDEVICEADDED which:0
SDL_JOYBUTTONDOWN: joystick: 0 button: 2 state: 1 code:290
SDL_JOYBUTTONUP: joystick: 0 button: 2 state: 0 code:290
SDL_JOYBUTTONDOWN: joystick: 0 button: 1 state: 1 code:289
SDL_JOYBUTTONUP: joystick: 0 button: 1 state: 0 code:289
SDL_JOYBUTTONDOWN: joystick: 0 button: 3 state: 1 code:291
SDL_JOYBUTTONUP: joystick: 0 button: 3 state: 0 code:291
SDL_JOYBUTTONDOWN: joystick: 0 button: 0 state: 1 code:288
SDL_JOYBUTTONUP: joystick: 0 button: 0 state: 0 code:288
SDL_JOYBUTTONDOWN: joystick: 0 button: 4 state: 1 code:292
SDL_JOYBUTTONUP: joystick: 0 button: 4 state: 0 code:292
SDL_JOYBUTTONDOWN: joystick: 0 button: 5 state: 1 code:293
SDL_JOYBUTTONUP: joystick: 0 button: 5 state: 0 code:293
SDL_JOYBUTTONDOWN: joystick: 0 button: 6 state: 1 code:294
SDL_JOYBUTTONUP: joystick: 0 button: 6 state: 0 code:294
SDL_JOYBUTTONDOWN: joystick: 0 button: 7 state: 1 code:295
SDL_JOYBUTTONUP: joystick: 0 button: 7 state: 0 code:295
SDL_JOYBUTTONDOWN: joystick: 0 button: 10 state: 1 code:298
SDL_JOYBUTTONUP: joystick: 0 button: 10 state: 0 code:298
SDL_JOYBUTTONDOWN: joystick: 0 button: 11 state: 1 code:299
SDL_JOYBUTTONUP: joystick: 0 button: 11 state: 0 code:299
SDL_JOYBUTTONDOWN: joystick: 0 button: 9 state: 1 code:297
SDL_JOYBUTTONUP: joystick: 0 button: 9 state: 0 code:297
SDL_JOYBUTTONDOWN: joystick: 0 button: 8 state: 1 code:296
SDL_JOYBUTTONUP: joystick: 0 button: 8 state: 0 code:296
SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 1 code: 16
SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 0 code: 16
SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 8 code: 16
SDL_JOYHATMOTION: joystick: 0 hat: 0 value: 0 code: 16
SDL_JOYAXISMOTION: joystick: 0 axis: 1 value: -841 code: 1
SDL_JOYAXISMOTION: joystick: 0 axis: 1 value: -19325 code: 1
SDL_JOYAXISMOTION: joystick: 0 axis: 1 value: -32768 code: 1
SDL_JOYAXISMOTION: joystick: 0 axis: 1 value: -26719 code: 1
SDL_JOYAXISMOTION: joystick: 0 axis: 1 value: 0 code: 1
SDL_JOYAXISMOTION: joystick: 0 axis: 0 value: -505 code: 0
SDL_JOYAXISMOTION: joystick: 0 axis: 0 value: -8907 code: 0
SDL_JOYAXISMOTION: joystick: 0 axis: 0 value: -27055 code: 0
SDL_JOYAXISMOTION: joystick: 0 axis: 0 value: -32768 code: 0
SDL_JOYAXISMOTION: joystick: 0 axis: 0 value: 0 code: 0
SDL_JOYAXISMOTION: joystick: 0 axis: 3 value: -8235 code: 5
SDL_JOYAXISMOTION: joystick: 0 axis: 3 value: -32096 code: 5
SDL_JOYAXISMOTION: joystick: 0 axis: 3 value: -32768 code: 5
SDL_JOYAXISMOTION: joystick: 0 axis: 3 value: -14284 code: 5
SDL_JOYAXISMOTION: joystick: 0 axis: 3 value: 0 code: 5
SDL_JOYAXISMOTION: joystick: 0 axis: 2 value: -19325 code: 2
SDL_JOYAXISMOTION: joystick: 0 axis: 2 value: -32768 code: 2
SDL_JOYAXISMOTION: joystick: 0 axis: 3 value: 6553 code: 5
SDL_JOYAXISMOTION: joystick: 0 axis: 3 value: 4537 code: 5
SDL_JOYAXISMOTION: joystick: 0 axis: 3 value: 0 code: 5
SDL_JOYAXISMOTION: joystick: 0 axis: 2 value: 0 code: 2
Dans mon cas
A : bouton n°2
B : bouton n°1
X : bouton n°3
Y : bouton n°0
L1 : bouton n°4
R1 : bouton n°5
L2 : bouton n°6
R2 : bouton n°7
L3 : bouton n°10
R3 : bouton n°11
START : bouton n°9
SELECT : bouton n°8
D-pad : hat 0
joystick gauche : axis
Pour interrompre le test tu appuies sur ton clavier cltr+c