• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Gamepad on Raspberry Pi won't register A and B buttons.

orbian

Member
I'm trying to get one of the generic USB gamepads (Buffalo, Kiwitata, etc) to work on the Raspberry Pi. The DPad works if you treat it as an analog stick and the X and Y buttons register along with the shoulder buttons.

The problem is the A and B buttons don't register at all. They work fine when using jstest-gtk and work fine in all my SDL programs.

This code will show which buttons register. On a Windows PC it registers all buttons. It's just on the Raspberry Pi that the A and B buttons don't work.

GML:
var gp_num = gamepad_get_device_count();
var b;
                
for (var i = 0; i < gp_num; i++;)
{
    if gamepad_is_connected(i)
    {
        var cnt;
        cnt = gamepad_button_count(i);

        for(var j=cnt; j>=0; j--;)
        {

            b = gamepad_button_check(i, j);
            if (b)
            {
                show_debug_message(string(cnt) + ":" + string(i) + ":" + string(j));
            }
        }
    }
}
 

TailBit

Member
My inner compiler reads this as "Inbox me so I can pass on a paid asset to you", but I sure hope I'm wrong...
inb4 is more to post what is considered a expected answer, so more like "I expect FHInput is a possible solution", so no ..

 
inb4 is more to post what is considered a expected answer, so more like "I expect FHInput is a possible solution", so no ..
Geez, what is wrong with typing?! 😂

To the OP:
Did you try Virtual Gamepad, with your Pi? It may fix it.
I don't think the code is the issue, here, otherwise your debug message would at least show up.
 

orbian

Member
Geez, what is wrong with typing?! 😂

To the OP:
Did you try Virtual Gamepad, with your Pi? It may fix it.
I don't think the code is the issue, here, otherwise your debug message would at least show up.
The gamepad works and I do get a debug message for buttons X and Y (and others). It's the A and B buttons that don't register. The gamepad works fine with all other programs on the Pi. It's just GameMaker that's not working as expected. An XBox controller will work correctly. I'm wondering it there is some way to get these missing buttons.
 

Jordnb

Member
Did you find a solution? I am also having issues with some buttons not registering and haven't had any luck resolving it.
 
Top