I have the Left Analog Stick programmed and accepting input (moving a character around). (getCompassDir() returns the values of the cardinal directions and NONE means the stick isn't touched):

// Left Analog Stick
public int getLeftAnalogStickDir() {
    // return the (x,y) analog stick compass direction
    if ((xAxisIdx == -1) || (yAxisIdx == -1)) {
        System.out.println("(x,y) axis data unavailable");
        return NONE;
    } else
        return getCompassDir(xAxisIdx, yAxisIdx);

This works perfectly. Now when trying to program the Right Analog Stick of the controller, I use the same code as above, but instead, I replaced xAxisIdx and yAxisIdx with zAxisIdx and rzAxisIdx (the x, y value of the right stick). The problem is that its not reading the input like the left Analog Stick.

Does anyone know why the right analog stick isnt working? I followed the tutorial from this book:

Pro Java 6 3D Game Development: Java 3D, JOGL, JInput and JOAL APIs

  • 1
    \$\begingroup\$ Could you elaborate on what "doesn't work" means? \$\endgroup\$ – Anko Dec 28 '14 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.