T
Tofu Heavy Industries
Guest
I can't get my game to recognize any directional input from a controller without analog sticks. Such as a 8bitdo nes/snes usb controller. If I plug in a XInput controller (such as a PS2 w/ usb converter), I can use either the analog sticks or the dpad, but if the controller doesn't have analog sticks, it won't take any directions at all.
Heres the setup for the controller
And heres some usage code in a step event:
What can I do to satisfy both usage of an analog stick and a controller with only a dpad?
Heres the setup for the controller
Code:
global.playcontrol_one = 255;
switch(async_load[? "event_type"]) // Parse the async_load map to see which event has been triggered
{
case "gamepad discovered":
if (global.playcontrol_one == 255) {global.playcontrol_one = async_load[? "pad_index"];
gamepad_set_axis_deadzone(global.playcontrol_one, 0.5); // Set the "deadzone" for the axis
gamepad_set_button_threshold(global.playcontrol_one, 0.1); // Set the "threshold" for the triggers
} else { global.playcontrol_two = async_load[? "pad_index"];
gamepad_set_axis_deadzone(global.playcontrol_two, 0.5); // Set the "deadzone" for the axis
gamepad_set_button_threshold(global.playcontrol_two, 0.1); // Set the "threshold" for the triggers
}
break;
case "gamepad lost": {
//Do nothing
}
break;
}
And heres some usage code in a step event:
Code:
var RIGHT = gamepad_button_check(global.playcontrol_one, gp_padr) || (gamepad_axis_value(global.playcontrol_one, gp_axislh) > 0)
var LEFT = (gamepad_button_check(global.playcontrol_one, gp_padl)) || (gamepad_axis_value(global.playcontrol_one, gp_axislh) < 0);