package org.usfirst.frc.team2503.r2016.input.gamepad;

public class LogitechF310Gamepad extends Gamepad {
	
	public Axis leftX = new Axis(AxisType.NEGATIVE_TO_POSITIVE, 0);
	public Axis leftY = new Axis(AxisType.NEGATIVE_TO_POSITIVE, 1);
	public Axis leftTrigger = new Axis(AxisType.ZERO_TO_POSITIVE, 2);
	
	public Axis rightTrigger = new Axis(AxisType.ZERO_TO_POSITIVE, 3);
	public Axis rightX = new Axis(AxisType.NEGATIVE_TO_POSITIVE, 4);
	public Axis rightY = new Axis(AxisType.NEGATIVE_TO_POSITIVE, 5);
	
	public boolean getAButton() { return this.getRawButton(1); }
	public boolean getBButton() { return this.getRawButton(2); }
	public boolean getXButton() { return this.getRawButton(3); }
	public boolean getYButton() { return this.getRawButton(4); }
	public boolean getBackButton() { return this.getRawButton(7); }
	public boolean getStartButton() { return this.getRawButton(8); }
	public boolean getLeftBumperButton() { return this.getRawButton(5); }
	public boolean getLeftStickButton() { return this.getRawButton(9); }
	public boolean getRightBumperButton() { return this.getRawButton(6); }
	public boolean getRightStickButton() { return this.getRawButton(10); }

	public boolean isAButtonPressed() { return this.getAButton(); }
	public boolean isAButtonUnpressed() { return !this.isAButtonPressed(); }
	public boolean isBButtonPressed() { return this.getBButton(); }
	public boolean isBButtonUnpressed() { return !this.isBButtonPressed(); }
	public boolean isXButtonPressed() { return this.getXButton(); }
	public boolean isXButtonUnpressed() { return !this.isXButtonPressed(); }
	public boolean isYButtonPressed() { return this.getYButton(); }
	public boolean isYButtonUnpressed() { return !this.isYButtonPressed(); }
	public boolean isBackButtonPressed() { return this.getBackButton(); }
	public boolean isBackButtonUnpressed() { return !this.isBackButtonPressed(); }
	public boolean isStartButtonPressed() { return this.getStartButton(); }
	public boolean isStartButtonUnpressed() { return !this.isStartButtonPressed(); }
	public boolean isLeftBumperButtonPressed() { return this.getLeftBumperButton(); }
	public boolean isLeftBumperButtonUnpressed() { return !this.isLeftBumperButtonPressed(); }
	public boolean isLeftStickButtonPressed() { return this.getLeftStickButton(); }
	public boolean isLeftStickButtonUnpressed() { return !this.isLeftStickButtonPressed(); }
	public boolean isRightBumperButtonPressed() { return this.getRightBumperButton(); }
	public boolean isRightBumperButtonUnpressed() { return !this.isRightBumperButtonPressed(); }
	public boolean isRightStickButtonPressed() { return this.getRightStickButton(); }
	public boolean isRightStickButtonUnpressed() { return !this.isRightStickButtonPressed(); }

	/**
	 * Get the value of the POV switch on this Gamepad.
	 *
	 * Note that getPOV (and hence this method) returns an integer value, where
	 * a value of 0 means that the POV is pointed NORTH, not EAST.
	 *
	 * If you're looking for a double value, use the below getPovDegrees() method.
	 *
	 * If you're looking for a double value, which could be passed to trigonometric
	 * functions (say Math.sin(double)), use the below getStandardPovDegrees()
	 * method.
	 */
	public int getPov() { return this.getPOV(0); }

	public double getPovDegrees() { return (double)this.getPov(); }
	public double getPovRadians() { return (Math.PI * this.getPovDegrees()) / 180.0d; }
	public double getStandardPovDegrees() { return 90.0d - this.getPovDegrees(); }
	public double getStandardPovRadians() { return (Math.PI * this.getStandardPovDegrees()) / 180.0d; }
	
	public LogitechF310Gamepad(int port) {
		super(port);
	}
	
}

@@ -48,16 +48,70 @@
 mepad;%0A%0A
+import edu.wpi.first.wpilibj.buttons.JoystickButton;%0A%0A
 public c
@@ -568,2227 +568,605 @@
 lic 
-boolean getAButton() %7B return this.getRawButton(1); %7D%0A%09public boolean getBButton() %7B return this.getRawButton(2); %7D%0A%09public boolean getXButton() %7B return this.getRawButton(3); %7D%0A%09public boolean getYButton() %7B return this.getRawButton(4); %7D%0A%09public boolean getBackButton() %7B return this.getRawButton(7); %7D%0A%09public boolean getStartButton() %7B return this.getRawButton(8); %7D%0A%09public boolean getLeftBumperButton() %7B return this.getRawButton(5); %7D%0A%09public boolean getLeftStickButton() %7B return this.getRawButton(9); %7D%0A%09public boolean getRightBumperButton() %7B return this.getRawButton(6); %7D%0A%09public boolean getRightStickButton() %7B return this.getRawButton(10); %7D%0A%0A%09public boolean isAButtonPressed() %7B return this.getAButton(); %7D%0A%09public boolean isAButtonUnpressed() %7B return !this.isAButtonPressed(); %7D%0A%09public boolean isBButtonPressed() %7B return this.getBButton(); %7D%0A%09public boolean isBButtonUnpressed() %7B return !this.isBButtonPressed(); %7D%0A%09public boolean isXButtonPressed() %7B return this.getXButton(); %7D%0A%09public boolean isXButtonUnpressed() %7B return !this.isXButtonPressed(); %7D%0A%09public boolean isYButtonPressed() %7B return this.getYButton(); %7D%0A%09public boolean isYButtonUnpressed() %7B return !this.isYButtonPressed(); %7D%0A%09public boolean isBackButtonPressed() %7B return this.getBackButton(); %7D%0A%09public boolean isBackButtonUnpressed() %7B return !this.isBackButtonPressed(); %7D%0A%09public boolean isStartButtonPressed() %7B return this.getStartButton(); %7D%0A%09public boolean isStartButtonUnpressed() %7B return !this.isStartButtonPressed(); %7D%0A%09public boolean isLeftBumperButtonPressed() %7B return this.getLeftBumperButton(); %7D%0A%09public boolean isLeftBumperButtonUnpressed() %7B return !this.isLeftBumperButtonPressed(); %7D%0A%09public boolean isLeftStickButtonPressed() %7B return this.getLeftStickButton(); %7D%0A%09public boolean isLeftStickButtonUnpressed() %7B return !this.isLeftStickButtonPressed(); %7D%0A%09public boolean isRightBumperButtonPressed() %7B return this.getRightBumperButton(); %7D%0A%09public boolean isRightBumperButtonUnpressed() %7B return !this.isRightBumperButtonPressed(); %7D%0A%09public boolean isRightStickButtonPressed() %7B return this.getRightStickButton(); %7D%0A%09public boolean isRightStickButtonUnpressed() %7B return !this.isRightStickButtonPressed(); %7D%0A
+JoystickButton A = new JoystickButton(this, 1);%0A%09public JoystickButton B = new JoystickButton(this, 2);%0A%09public JoystickButton X = new JoystickButton(this, 3);%0A%09public JoystickButton Y = new JoystickButton(this, 4);%0A%09public JoystickButton Back = new JoystickButton(this, 7);%0A%09public JoystickButton Start = new JoystickButton(this, 8);%0A%09public JoystickButton LeftBumper = new JoystickButton(this, 5);%0A%09public JoystickButton LeftStick = new JoystickButton(this, 9);%0A%09public JoystickButton RightBumper = new JoystickButton(this, 6);%0A%09public JoystickButton RightStick = new JoystickButton(this, 10);%0A%09
 %0A%09/*

Replace the old, repetitive code with WPIlib smart code.