hogwater
Member
This is from the step event of a "button listener" object used for a controller config option. It's intended to recognize buttons 0-17 on the pad, then drop those values into variables. It works well for most pads I have.
However with the wired Hori Switch Pro Controller, I can't get anything from the dpad or the Y button.
Using https://gamepad-tester.com/ I see the dpad as buttons 12-15, and the Y button as button 2. The gamepad setup utility in Windows 10 sees the dpad as pov hat directions, and the Y button as button 1.
Wat do?
However with the wired Hori Switch Pro Controller, I can't get anything from the dpad or the Y button.
Using https://gamepad-tester.com/ I see the dpad as buttons 12-15, and the Y button as button 2. The gamepad setup utility in Windows 10 sees the dpad as pov hat directions, and the Y button as button 1.
Wat do?
Code:
/// @description listen for buttons and grab the one pressed
if gamepad_button_check_pressed(global.player1,0)
{
global.listener_button = 0;
global.display_gbutton = "Dpad Up"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,1)
{
global.listener_button = 1;
global.display_gbutton = "Dpad Down"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,2)
{
global.listener_button = 2;
global.display_gbutton = "Dpad Left"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,3)
{
global.listener_button = 3;
global.display_gbutton = "Dpad Right"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,14)
{
global.listener_button = 14;
global.display_gbutton = "X"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,12)
{
global.listener_button = 12;
global.display_gbutton = "A";
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,15)
{
global.listener_button = 15;
global.display_gbutton = "Y"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,13)
{
global.listener_button = 13;
global.display_gbutton = "B"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,8)
{
global.listener_button = 8;
global.display_gbutton = "LB"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,9)
{
global.listener_button = 9;
global.display_gbutton = "RB"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,10)
{
global.listener_button = 10;
global.display_gbutton = "LT"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,11)
{
global.listener_button = 11;
global.display_gbutton = "RT"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,5)
{
global.listener_button = 5;
global.display_gbutton = "Select"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,4)
{
global.listener_button = 4;
global.display_gbutton = "Start"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,6)
{
global.listener_button = 6;
global.display_gbutton = "LS"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,7)
{
global.listener_button = 7;
global.display_gbutton = "RS"
instance_destroy();
}
//extras just in case
if gamepad_button_check_pressed(global.player1,16)
{
global.listener_button = 16;
global.display_gbutton = "B 16"
instance_destroy();
}
if gamepad_button_check_pressed(global.player1,17)
{
global.listener_button = 17;
global.display_gbutton = "B 17"
instance_destroy();
}