Add ToggleIndexerPiston class
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / OI.java
index bf3c20f34b0d08ce94ab5970d566dc32aaaae293..07ad53c765b9f50318f9cb024d4a46c1344e02e1 100644 (file)
@@ -1,8 +1,5 @@
 package org.usfirst.frc.team3501.robot;
 
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-
 import org.usfirst.frc.team3501.robot.commands.climber.ToggleWinch;
 import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
 import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous;
@@ -12,13 +9,14 @@ import org.usfirst.frc.team3501.robot.commands.shooter.IncreaseShootingSpeed;
 import org.usfirst.frc.team3501.robot.commands.shooter.ReverseIndexWheelContinuous;
 import org.usfirst.frc.team3501.robot.commands.shooter.RunFlyWheelContinuous;
 import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous;
+import org.usfirst.frc.team3501.robot.commands.shooter.ToggleIndexerPiston;
 import org.usfirst.frc.team3501.robot.utils.ChangeCameraView;
 
 import edu.wpi.first.wpilibj.Joystick;
 import edu.wpi.first.wpilibj.buttons.Button;
 import edu.wpi.first.wpilibj.buttons.JoystickButton;
 
-public class OI implements KeyListener {
+public class OI /* implements KeyListener */ {
   private static OI oi;
   public static Joystick leftJoystick;
   public static Joystick rightJoystick;
@@ -38,7 +36,11 @@ public class OI implements KeyListener {
 
   private static Button changeCam;
 
+  private static Button togglePiston;
+  private static Button toggleDriveTrainPiston;
+
   public OI() {
+
     leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
     rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
 
@@ -80,6 +82,14 @@ public class OI implements KeyListener {
     changeCam = new JoystickButton(rightJoystick,
         Constants.OI.CHANGE_CAMERA_VIEW);
     changeCam.toggleWhenPressed(new ChangeCameraView());
+
+    togglePiston = new JoystickButton(rightJoystick,
+        Constants.Shooter.TOGGLE_INDEXER);
+    togglePiston.whenPressed(new ToggleIndexerPiston());
+
+    toggleDriveTrainPiston = new JoystickButton(rightJoystick,
+        Constants.DriveTrain.TOGGLE_DRIVE_PISTON);
+    toggleDriveTrainPiston.whenPressed(new ToggleGear());
   }
 
   public static OI getOI() {
@@ -88,20 +98,16 @@ public class OI implements KeyListener {
     return oi;
   }
 
-  @Override
-  public void keyTyped(KeyEvent e) {
-
-  }
-
-  @Override
-  public void keyPressed(KeyEvent e) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public void keyReleased(KeyEvent e) {
-    // TODO Auto-generated method stub
+  /*
+   * @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() ==
+   * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
+   * Robot.getShooter().runIndexWheel(); } }
+   *
+   * @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() ==
+   * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
+   * Robot.getShooter().stopIndexWheel(); } }
+   *
+   * @Override public void keyTyped(KeyEvent e) { }
+   */
 
-  }
 }