Page 1 of 1

Remapping XInput xbox 360 gamepad

Posted: 21 Sep 2018, 16:56
by AEBus
Hello. My gamepad (wired xbox 360 gamepad) supported by the game and all buttons work fine. But i want swap A (CROSS) with B (CIRCLE).
Buttons in debug consolle are defined as follows:

Code: Select all

TRIANGLE (Y) — Gamepad event, button: 3
CIRCLE (B) — Gamepad event, button: 1
CROSS (A) — Gamepad event, button: 0
SQUARE (X) — Gamepad event, button: 2
L1 (left trigger?) — when pressed nothing happens in console and in game
R1 (right trigger?) — when pressed nothing happens in console, but in game button work as skip
DOWN (direct pad?) — Gamepad event, hat move: 4 (when pressed)/ Gamepad event, hat move: 0 (when released)
LEFT (direct pad?) — Gamepad event, hat move: 8 (when pressed)/ Gamepad event, hat move: 0 (when released)
UP (direct pad?) — Gamepad event, hat move: 1 (when pressed)/ Gamepad event, hat move: 0 (when released)
RIGHT (direct pad?) — Gamepad event, hat move: 2 (when pressed)/ Gamepad event, hat move: 0 (when released)
SELECT (back) — Gamepad event, button: 6
START (start) — Gamepad event, button: 7
HOME (guide?) — Gamepad event, button: 10
L2 (left bumper?) — Gamepad event, button: 4
R2 (right bumper?) — Gamepad event, button: 5
L3 (pressed left stick?) — Gamepad event, button: 8
R3 (pressed right stick?) — Gamepad event, button: 9
EXTRA (i dont know what is)
DOWN (direct pad?) — Gamepad event, hat move: 4 (when pressed)/ Gamepad event, hat move: 0 (when released)
LEFT (direct pad?) — Gamepad event, hat move: 8 (when pressed)/ Gamepad event, hat move: 0 (when released)
UP (direct pad?) — Gamepad event, hat move: 1 (when pressed)/ Gamepad event, hat move: 0 (when released)
RIGHT (direct pad?)  — Gamepad event, hat move: 2 (when pressed)/ Gamepad event, hat move: 0 (when released)
so, i want swap A (CROSS) with B (CIRCLE), and in config i wrote this:

Code: Select all

pad-map=3,0,1,2,-1,-1,4,8,1,2,6,7,10,4,5,8,9,-1,4,8,1,2
With this parameter direct pad buttons not work, when i press CIRCLE (B) triggered UP, when i press L2 (LB) triggered DOWN.

Re: Remapping XInput xbox 360 gamepad

Posted: 22 Sep 2018, 11:43
by vit9696
Just like Knox said, last 4 numbers should be 18,19,20,21. The engine is misleading as in hat case it prints sdl keycodes instead of ons mapped buttons:

Code: Select all

pad-map=3,0,1,2,-1,-1,4,8,1,2,6,7,10,4,5,8,9,-1,18,19,20,21
We will fix it in a subsequent update ;)

Re: Remapping XInput xbox 360 gamepad

Posted: 22 Sep 2018, 14:48
by AEBus
I am confused by the fact that in the configuration these buttons are mentioned 2 times
TRIANGLE, CIRCLE, CROSS, SQUARE, L1, R1, DOWN, LEFT, UP, RIGHT, SELECT, START, HOME, L2, R2, L3, R3, EXTRA, DOWN, LEFT, UP, RIGHT

Re: Remapping XInput xbox 360 gamepad

Posted: 22 Sep 2018, 14:58
by vit9696
There should not be any confusion here, some gamepads report arrows as buttons (first four), and some others as hat moves (second four). Second four buttons are a later addition, and I was not careful enough to label them carefully.

Knox, could you please update our FAQs to use HAT_ prefix for the second group? HAT_DOWN, HAT_UP, etc.

Re: Remapping XInput xbox 360 gamepad

Posted: 22 Sep 2018, 15:04
by AEBus
With
pad-map=3,0,1,2,-1,-1,4,8,1,2,6,7,10,4,5,8,9,-1,18,19,20,21
direct pad buttons work, but when i press CIRCLE (B) triggered UP, when i press L2 (LB) triggered DOWN.

With
pad-map=3,0,1,2,-1,-1,18,19,20,21,6,7,10,4,5,8,9,-1,18,19,20,21
all buttons work fine

Re: Remapping XInput xbox 360 gamepad

Posted: 22 Sep 2018, 15:12
by vit9696
Ah, did not notice you had the first four confused as well, yes, that is right.