• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows Generic Gamepad Doesn't Work Half The Time

matharoo

manualman
GameMaker Dev.
I have one Xbox controller and a generic one. The former works fine, but the latter is not detected half the time. It seems like it starts and stop working at random (not while the game is on, it just either detects it at the beginning or it doesn't).

This is the code in my Async System event:
Code:
//Gamepad
var type = async_load[? "event_type"];
var _gp = async_load[? "pad_index"];

//Connected
if (type=="gamepad discovered"){
    global.gp[gpCount++] = _gp;
  
    log("Gamepad connected: " + string(_gp));
  
    if (global.gp_main < 0){
        global.gp_main = _gp;
    }
}
//Disconnected
else if (type=="gamepad lost"){
    //Remove main
    if (global.gp_main == _gp) global.gp_main = -1;
  
    //Remove gp
    for(var i=0; i<gpCount; i++){
        if (global.gp[i] == _gp){
            global.gp[i] = -1;
        }
    }
}
My Xbox one's ID is 0 and the generic one's is 4.
Any ideas?
 

Bruchpilot

Member
When the other one is not being detected.. have you had a chance to check if any other game or software can see it in that state?
 

matharoo

manualman
GameMaker Dev.
When the other one is not being detected.. have you had a chance to check if any other game or software can see it in that state?
Yes, if I open its properties in Windows I can test all the keys and axes, and they work. Haven't tested in an actual game though.
 

Gzebra

Member
Whilst not being a solution to your project, you can emulate an xbox controller with your generic controller using 360ce. Maybe you can use this for testing purposes if nothing else.
 

matharoo

manualman
GameMaker Dev.
While not being a solution to your project, you can emulate an xbox controller with your generic controller using 360ce. Maybe you can use this for testing purposes if nothing else.
I'll try that the next time my controller doesn't work, thanks!
 
Top