• 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!
  • 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.

Mac OSX Pro Controller Trigger Problems

A

Arlo Heskett

Guest
Hi everyone,
I have recently been experiencing issues while using the Nintendo Switch Pro Controller on Game Maker. The basic issue is that Game Maker doesn't take any input from both the left and right triggers. It hasn't always been like this but recently after a few updates ago I noticed that this issue started.

Everything aside from the triggers works. I have tried using the controller on things aside from Game Maker and the triggers work completely fine. The image below is a screenshot of a small programme I created to test the inputs of the controller.

Test Programme:

<Image Link Removed - Malicious Domain Detected>/ja0f3c

Here's the code. If there is anything that is incorrect with it that is causing the issue, please make sure to tell me :)

[Step Event]
// Get controller
controllerconnection = gamepad_get_description(0);

// Axis input
lhaxis = gamepad_axis_value(0, gp_axislh);
lvaxis = gamepad_axis_value(0, gp_axislv);
rhaxis = gamepad_axis_value(0, gp_axisrh);
rvaxis = gamepad_axis_value(0, gp_axisrv);
if (gamepad_button_check(0, gp_face1)) facebutton1 = true else facebutton1 = false;
if (gamepad_button_check(0, gp_face2)) facebutton2 = true else facebutton2 = false;
if (gamepad_button_check(0, gp_face3)) facebutton3 = true else facebutton3 = false;
if (gamepad_button_check(0, gp_face4)) facebutton4 = true else facebutton4 = false;
if (gamepad_button_check(0, gp_shoulderr)) rightbumper = true else rightbumper = false;
if (gamepad_button_check(0, gp_shoulderl)) leftbumper = true else leftbumper = false;
if (gamepad_button_check(0, gp_shoulderrb)) righttrigger = true else righttrigger = false;
if (gamepad_button_check(0, gp_shoulderlb)) lefttrigger = true else lefttrigger = false;

[Draw GUI Event]
// Get controller
draw_text(80, 40, controllerconnection);
draw_text(80, 55, lhaxis);
draw_text(80, 70, lvaxis);
draw_text(80, 85, rhaxis);
draw_text(80, 100, rvaxis);
if (facebutton1 = true) draw_text(80, 115, "A Button True") else draw_text(80, 115, "A Button False");
if (facebutton2 = true) draw_text(80, 130, "B Button True") else draw_text(80, 130, "B Button False");
if (facebutton3 = true) draw_text(80, 145, "X Button True") else draw_text(80, 145, "X Button False");
if (facebutton4 = true) draw_text(80, 160, "Y Button True") else draw_text(80, 160, "Y Button False");
if (rightbumper = true) draw_text(80, 175, "Right Bumper True") else draw_text(80, 175, "Right Bumper False");
if (leftbumper = true) draw_text(80, 190, "Left Bumper True") else draw_text(80, 190, "Left Bumper False");
if (righttrigger = true) draw_text(80, 205, "Right Trigger True") else draw_text(80, 205, "Right Trigger False");
if (lefttrigger = true) draw_text(80, 220, "Left Trigger True") else draw_text(80, 220, "Left Trigger False");


(Even though this has nothing to do with the issue, just in case this is part of or is the cause of the problem) I also have a draw event with nothing inside of it just so that the sprite is invisible.

[Draw Event]
// Invisible


Thanks for taking your time to read my post :D. Hopefully we can try to find out the cause of this and fix it :). Perhaps this is only an issue that occurs on the Mac IDE (I don't know if it works on Windows because I only use a mac).
 

hogwater

Member
Are you getting input from the Switch controller with slot 0? It shouldn't be an XInput pad.

Anyway, the GM button constants don't cover all the available buttons. Try using this tool that @Mick here on the forums made to see what numbers correspond to the triggers on your controller, and use those instead of the constants in your button checks.

http://www.gamephase.net/files/linked/GamePadTestGMS2.zip

-BTW Mick, I'm tagging you for proper credit. If this is annoying or you would like me to stop linking to your website feel free to let me know.
 
A

Arlo Heskett

Guest
Are you hard coding the pad to slot 0? You really shouldn't... it's better to use the System Async event to detect a pad, and then get the index that way and store it in a variable. Not saying this is going to solve your issue, but it's the "correct" way to detect gamepads and you should probably fix it at some point. :)

http://docs2.yoyogames.com/index.html?page=source/_build/2_interface/1_editors/events/async_events.html
Yeah, I would use that (and do) for an actual game. This is just a short programme I made in 5 mins to check if the triggers gave any input at all. I didn't see much point in setting that up because I knew which slot the controller would come up in.

Are you getting input from the Switch controller with slot 0? It shouldn't be an XInput pad.

Anyway, the GM button constants don't cover all the available buttons. Try using this tool that @Mick here on the forums made to see what numbers correspond to the triggers on your controller, and use those instead of the constants in your button checks.

http://www.gamephase.net/files/linked/GamePadTestGMS2.zip

-BTW Mick, I'm tagging you for proper credit. If this is annoying or you would like me to stop linking to your website feel free to let me know.
Thanks for that link, I'll check it out. On Mac there is no XInput, every type of controller shares the same slots.

Edit: I can't run a .exe file because I'm on Mac :/. Looks like I need to find another way.
 
Last edited by a moderator:

hogwater

Member
Oh, interesting. Didn't know that about Mac.

If your OS has a game controller utility where you can test buttons etc you can try that to get the numbers.

Otherwise just start trying numbers 16 and above (that's where the buttons that GM constants don't cover start) sequentially until you find the right ones.

-edit: you know, there was some sort of Mac related trigger button bug now that I think of it. But updates since then should have fixed it?
 
A

Arlo Heskett

Guest
Oh, interesting. Didn't know that about Mac.

If your OS has a game controller utility where you can test buttons etc you can try that to get the numbers.

Otherwise just start trying numbers 16 and above (that's where the buttons that GM constants don't cover start) sequentially until you find the right ones.

-edit: you know, there was some sort of Mac related trigger button bug now that I think of it. But updates since then should have fixed it?
Well I am going to try the playstation 4 controller again to see if it works (I tried it before and it worked fine but I'll try it out again to find out if this is a more general gamepad issue).
 
A

Arlo Heskett

Guest
I know it works for Pc at least
But controllers on mac use different port numbers. I get all the input from port 0 for the controller except the triggers so I don't think its a problem with which port I am using.
 
Top