How to make unsupported (some) GamePads' arrows work? (solved)

0 favourites
  • 2 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi.

    I have a problem with detecting Arrows with D-pad. I see it is a common issue, but I didn't find any solution.

    In my case, arrows don't work at all (via "On Gamepad O D-pad left pressed" (and other directions)), unless I try to detect it's number with GamePad.LastButton - it gives:

    Right: 17

    Down: 16

    Left and Up don't return anything.

    Help, pretty please... ^^

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I figured it out, maybe it will help someone:

    Since Arrows don't work in "unsupported" gamepads, you should check if X/Y-axis recognition works with your pad.

    With my pads, it works partially: it can only detects if an axis is chenged or not.

    For example:

    AXIS LEFT returns value: X: -100, Y: -3,94620574123

    AXIS RIGHT returns value: X: 100, Y: -3,94620574123

    AXIS UP returns value: X: -3,94620574123, Y: -100

    AXIS DOWN returns value: X: -3,94620574123, Y: 100

    It doesn't detect the real analog axis deflection between -100 and 100, but it's good enough.

    NOTE that the value of -3,94... is understood as NO movement in that direction (on my pads at least).

    With that, we can do something like that:

    Gamepad Gamepad 0 Left Analog X Axis < -10 : LEFT

    note, I used value of -10 not 0: this gives us detection of a LEFT button in a range between -10 to -100 (because -3,94... means no movement), so -10 gives us some safe margin.

    Hope it helped someone :)

    P.S.

    This behaviour will simulate "on button down".

    If you want to simulate "on button pressed" (once), you need to add a "Trigger once if true" to the event.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)