1

I've been trying to figure this out for some time. Basically I recently purchased some cheap Snes controllers off Amazon. (https://www.amazon.com/iNNEXT-Nintendo-Controller-Gamestick-Raspberry/dp/B01N7ANDLC/ref=sr_1_9?s=videogames&ie=UTF8&qid=1516067256&sr=1-9&keywords=snes+controller) They have worked fine on my RaspberryPi, however when trying to use them with GameMaker the horizontal axis (left and right on the d-pad) are being used as every axis. Everything else works fine (ABXY, shoulder buttons, etc). I'm not sure if I'm just being stupid or what. Here's my code:

//CREATE EVENT
gp = 4;
gamepad_set_axis_deadzone(gp,0.5)
spd = 8;

//STEP EVENT
x += gamepad_axis_value(gp,gp_axislh) * spd;
y += gamepad_axis_value(gp,gp_axislv) * spd;

Thanks in advance

Gavin Grey
  • 11
  • 1

1 Answers1

0

Occasionally off-brand gamepads have unusual axis mapping on Windows - I'd suggest to try displaying values of all axes (lh/lv/rh/rv) as well as values of dpad and normal buttons.

If tested Pi games were built with SDL components, chances are that they were using SDL_GameControllerDB with various gamepad models pre-mapped.

If everything else fails, you can also try the legacy joystick_ functions which allow to pull additional DirectInput-specific axes.

YellowAfterlife
  • 2,967
  • 1
  • 16
  • 24