1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

XBOX360 shoulder buttons/axes

Discussion in 'Programming' started by kburkhart84, Oct 24, 2016.

  1. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    467
    I'm working on my kbinput extension...I'm seeing that the gp_shoulderlb and gp_shoulderrb axes are actually set up as buttons in GMS's input code. I had it understood that these are axes, not just buttons. If I try to use that constant with the axis checking function, it instead checks the left horizontal axis for the left shoulder button/axis. But when I check the buttons, I get a good 0/1 value for the button.

    So, is there something I'm missing, or something GMS isn't doing right? I was expecting to get a decimal value between 0 and 1 depending on how far those buttons are depressed(they are axes after all). In the windows control panel, it has them combined as a single Z axis, where pushing the left makes it go positive and pushing the right makes it go negative, which is actually the behavior that happens when using DInput instead of XInput for these gamepads.
     
  2. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,448
    I think the shoulders are digital and only the triggers are analog.
     
  3. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    467
    Exactly, but it is the triggers that are not working as analog, rather as if they were simply buttons and not analog axes.
     
  4. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    467
    Yeah, I thought I had that stuff working right when I coded the previous version of my kbinput thingy...it has been so long though so I wasn't sure. Thanks for the help testing...maybe they will fix it.

    [edit]

    I actually outputted the values of the constants at first, and the gp_shoulderlb has a different value than the one for the horizontal left axis, even though when you use the gp_shoulderlb constant in the axis checking function it checks the left horizontal axis.

    I didn't do any more testing on the right side, or the constants at that point though, as I had in my head the idea that these things were instead being counted as buttons for whatever reason.
     
    Last edited: Oct 24, 2016
    Lonewolff likes this.
  5. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    467
    Yes, they all were reading that same axis for whatever reason. Also, I saw that ninja edit and mentioned about the constants I tested as well.
     
    Lonewolff likes this.
  6. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    467
    I appreciate that...I also saw you "mention" Mike and Russell. Saved me the effort on both bug report and mentions. Thanks for that.
     
    Lonewolff likes this.
  7. kburkhart84

    kburkhart84 Firehammer Games

    Joined:
    Jun 26, 2016
    Posts:
    467
    @Mike @rwkay @Lonewolff

    Did anything ever come out of this bug report? I'm using the just released(just out of beta) version of GMS2 and it still has this bug.
     
  8. InfraGhosts

    InfraGhosts Member

    Joined:
    Oct 31, 2019
    Posts:
    1
    If anyone sees this the problem is using "gamepad_axis_value()" will not work with button pushes or triggers. Try "gamepad_button_value()" for triggers and "gamepad_button_check()" for buttons. Put this in an object and put it in you room and see how you go:

    refNum = 0 // Your controller number 0-3 for xinput 4-7 for directInput
    axislh = gamepad_axis_value(refNum, gp_axislh); // Left xAxis
    axislv = gamepad_axis_value(refNum, gp_axislv); // Left yAxis
    axisrh = gamepad_axis_value(refNum, gp_axisrh); // Right xAxis
    axisrv = gamepad_axis_value(refNum, gp_axisrv); // Right yAxis
    shoulderlb = gamepad_button_value(refNum, gp_shoulderlb); // Left Trigger
    shoulderrb = gamepad_button_value(refNum, gp_shoulderrb); // Right Trigger
    face1 = gamepad_button_check(refNum, gp_face1); // A
    face2 = gamepad_button_check(refNum, gp_face2); // B
    face3 = gamepad_button_check(refNum, gp_face3); // X
    face4 = gamepad_button_check(refNum, gp_face4); // Y
    shoulderl = gamepad_button_check(refNum, gp_shoulderl); // Left Bumper
    shoulderr = gamepad_button_check(refNum, gp_shoulderr); // Right Bumper
    select = gamepad_button_check(refNum, gp_select); // Select
    start = gamepad_button_check(refNum, gp_start); // Start
    stickl = gamepad_button_check(refNum, gp_stickl); // Left Stick Down
    stickr = gamepad_button_check(refNum, gp_stickr); // Right Stick Down
    padu = gamepad_button_check(refNum, gp_padu); // Pad Up
    padd = gamepad_button_check(refNum, gp_padd); // Pad Down
    padl = gamepad_button_check(refNum, gp_padl); // Pad Right
    padr = gamepad_button_check(refNum, gp_padr); // Pad Left

    draw_text_transformed(
    x, y, "MidiRad Triggers \n"
    + "\nLeft X=" + string(axislh)
    + "\nLeft Y=" + string(axislv)
    + "\nRight X=" + string(axisrh)
    + "\nRight Y=" + string(axisrv)
    + "\nLeft Slider=" + string(shoulderlb)
    + "\nRight Slider=" + string(shoulderrb)
    + "\nA=" + string(face1)
    + "\nB=" + string(face2)
    + "\nX=" + string(face3)
    + "\nY=" + string(face4)
    + "\nLButton=" + string(shoulderl)
    + "\nRButton=" + string(shoulderr)
    + "\nSelect=" + string(select)
    + "\nStart=" + string(start)
    + "\nStickL=" + string(stickl)
    + "\nStickR=" + string(stickr)
    + "\nUp=" + string(padu)
    + "\nRight=" + string(padr)
    + "\nDown=" + string(padd)
    + "\nLeft=" + string(padl)
    ,1 ,1 ,0);
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice