Thank you all for the feedback.
There seems to be a hardware limitation in the gamepad for the buttons I tested. In the PlayStation style, the face buttons worked. Perhaps the one i tested are not designed for multiple simultaneous presses.
Just for the record, here is the SDL2 snippet code:
// Game loop
while (!quit) {
// Handle events on queue
while (SDL_PollEvent(&e) != 0) {
// User requests quit
if (e.type == SDL_QUIT) {
quit = 1;
}
// Joystick button pressed
else if (e.type == SDL_JOYBUTTONDOWN) {
printf(“Button %d pressed. type:%d\n”, e.jbutton.button, e.type);
}
// Joystick button released
else if (e.type == SDL_JOYBUTTONUP) {
printf(“Button %d released. type:%d\n”, e.jbutton.button, e.type);
}
// Joystick axis motion
else if (e.type == SDL_JOYAXISMOTION) {
// Motion on axis 0 (X-axis) or 1 (Y-axis)
if (e.jaxis.axis >= 0 || e.jaxis.axis == 1) {
printf(“Axis %d moved to %d\n”, e.jaxis.axis, e.jaxis.value);
}
}
// Joystick hat motion
else if (e.type == SDL_JOYHATMOTION) {
printf(“Hat %d moved to %d\n”, e.jhat.hat, e.jhat.value);
}
}
}
Here are the events generated (or not generated, pushing button1, holding it and pushing button 2 and holding it, and at last releasing buttons and pushing button 2):
/dev/input/event13: 广东聚慧飞科技 穿越机手柄
Select the device event number [0-13]: 13
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x1209 product 0x4f54 version 0x111
Input device name: “广东聚慧飞科技 穿越机手柄”
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 288 (BTN_TRIGGER)
Event code 289 (BTN_THUMB)
Event code 290 (BTN_THUMB2)
Event code 291 (BTN_TOP)
Event code 292 (BTN_TOP2)
Event code 293 (BTN_PINKIE)
Event code 294 (BTN_BASE)
Event code 295 (BTN_BASE2)
Event code 296 (BTN_BASE3)
Event code 297 (BTN_BASE4)
Event code 298 (BTN_BASE5)
Event code 299 (BTN_BASE6)
Event code 300 (?)
Event code 301 (?)
Event code 302 (?)
Event code 303 (BTN_DEAD)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 128
Min 0
Max 250
Flat 15
Event code 1 (ABS_Y)
Value 129
Min 0
Max 250
Flat 15
Event code 2 (ABS_Z)
Value 12
Min 0
Max 250
Flat 15
Event code 3 (ABS_RX)
Value 128
Min 0
Max 250
Flat 15
Event code 4 (ABS_RY)
Value 113
Min 0
Max 250
Flat 15
Event code 5 (ABS_RZ)
Value 130
Min 0
Max 250
Flat 15
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing … (interrupt to exit)
Event: time 1759753934.742824, type 3 (EV_ABS), code 3 (ABS_RX), value 129
Event: time 1759753934.742824, -------------- SYN_REPORT ------------
Event: time 1759753934.774825, type 3 (EV_ABS), code 3 (ABS_RX), value 128
Event: time 1759753934.774825, -------------- SYN_REPORT ------------
Event: time 1759753934.870822, type 3 (EV_ABS), code 3 (ABS_RX), value 129
Event: time 1759753934.870822, -------------- SYN_REPORT ------------
Event: time 1759753934.902824, type 3 (EV_ABS), code 3 (ABS_RX), value 128
Event: time 1759753934.902824, -------------- SYN_REPORT ------------
Event: time 1759753936.278812, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1759753936.278812, type 1 (EV_KEY), code 288 (BTN_TRIGGER), value 1
Event: time 1759753936.278812, -------------- SYN_REPORT ------------
Event: time 1759753937.462803, type 3 (EV_ABS), code 1 (ABS_Y), value 128
Event: time 1759753937.462803, -------------- SYN_REPORT ------------
Event: time 1759753937.494806, type 3 (EV_ABS), code 1 (ABS_Y), value 129
Event: time 1759753937.494806, type 3 (EV_ABS), code 3 (ABS_RX), value 129
Event: time 1759753937.494806, -------------- SYN_REPORT ------------
Event: time 1759753937.526804, type 3 (EV_ABS), code 3 (ABS_RX), value 128
Event: time 1759753937.526804, -------------- SYN_REPORT ------------
Event: time 1759753940.950776, type 3 (EV_ABS), code 1 (ABS_Y), value 128
Event: time 1759753940.950776, -------------- SYN_REPORT ------------
Event: time 1759753940.982779, type 3 (EV_ABS), code 1 (ABS_Y), value 129
Event: time 1759753940.982779, -------------- SYN_REPORT ------------
Event: time 1759753941.494774, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1759753941.494774, type 1 (EV_KEY), code 288 (BTN_TRIGGER), value 0
Event: time 1759753941.494774, -------------- SYN_REPORT ------------
Event: time 1759753943.382758, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1759753943.382758, type 1 (EV_KEY), code 289 (BTN_THUMB), value 1
Event: time 1759753943.382758, -------------- SYN_REPORT ------------
Event: time 1759753944.214752, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1759753944.214752, type 1 (EV_KEY), code 289 (BTN_THUMB), value 0
Event: time 1759753944.214752, -------------- SYN_REPORT ------------