Quote:
Originally Posted by LFRobotics
So .LEFTJOY_X is enum but .LEFTJOY_Y is not - those are pointers to getRawAxis() in the XBox class - I will try that but I don't know if it will do anything.
|
You need to use the methods in the class instead of the enum.
Code:
public boolean getButtonA() {
return getRawButton(A_BUTTON);
}
public boolean getButtonB() {
return getRawButton(B_BUTTON);
}
public boolean getButtonX() {
return getRawButton(X_BUTTON);
}
public boolean getButtonY() {
return getRawButton(Y_BUTTON);
}
public boolean getButtonRB() {
return getRawButton(RB_BUTTON);
}
public boolean getButtonLB() {
return getRawButton(LB_BUTTON);
}
public boolean getButtonRS() {
return getRawButton(RS_BUTTON);
}
public boolean getButtonLS() {
return getRawButton(LS_BUTTON);
}
public boolean getButtonStart() {
return getRawButton(START_BUTTON);
}
public boolean getButtonBack() {
return getRawButton(BACK_BUTTON);
}
public double getLeftJoyY() {
return getRawAxis(LEFTJOY_Y);
}
public double getLeftJoyX() {
return getRawAxis(LEFTJOY_X);
}
public double getRightJoyY() {
return getRawAxis(RIGHTJOY_Y);
}
public double getRightJoyX(){
return getRawAxis(RIGHTJOY_X);
}
public double getRightTrigger() {
return -Math.min(getRawAxis(RIGHT_TRIGGER), 0);
}
public double getLeftTrigger() {
return Math.max(getRawAxis(LEFT_TRIGGER), 0);
}
The methods take the enum values that represent button and axis numbers and gets the actual feedback from the joystick.