1 package org
.usfirst
.frc
.team3501
.robot
;
3 import java
.awt
.event
.KeyEvent
;
4 import java
.awt
.event
.KeyListener
;
6 import org
.usfirst
.frc
.team3501
.robot
.commands
.climber
.ToggleWinch
;
7 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.ToggleGear
;
8 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.ReverseIntakeContinuous
;
9 import org
.usfirst
.frc
.team3501
.robot
.commands
.intake
.RunIntakeContinuous
;
10 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.DecreaseShootingSpeed
;
11 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.IncreaseShootingSpeed
;
12 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.ReverseIndexWheelContinuous
;
13 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunFlyWheelContinuous
;
14 import org
.usfirst
.frc
.team3501
.robot
.commands
.shooter
.RunIndexWheelContinuous
;
15 import org
.usfirst
.frc
.team3501
.robot
.utils
.ChangeCameraView
;
17 import edu
.wpi
.first
.wpilibj
.Joystick
;
18 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
19 import edu
.wpi
.first
.wpilibj
.buttons
.JoystickButton
;
21 public class OI
implements KeyListener
{
23 public static Joystick leftJoystick
;
24 public static Joystick rightJoystick
;
25 public static Button toggleWinch
;
27 public static Button runIndexWheel
;
28 public static Button reverseIndexWheel
;
29 public static Button toggleFlyWheel
;
31 public static Button toggleGear
;
33 public static Button runIntake
;
34 public static Button reverseIntake
;
36 public static Button increaseShooterSpeed
;
37 public static Button decreaseShooterSpeed
;
39 private static Button changeCam
;
42 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
43 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
45 runIndexWheel
= new JoystickButton(rightJoystick
,
46 Constants
.OI
.RUN_INDEXWHEEL_PORT
);
47 runIndexWheel
.whileHeld(new RunIndexWheelContinuous());
49 reverseIndexWheel
= new JoystickButton(rightJoystick
,
50 Constants
.OI
.REVERSE_INDEXWHEEL_PORT
);
51 reverseIndexWheel
.whileHeld(new ReverseIndexWheelContinuous());
53 toggleFlyWheel
= new JoystickButton(rightJoystick
,
54 Constants
.OI
.TOGGLE_FLYWHEEL_PORT
);
55 toggleFlyWheel
.toggleWhenPressed(new RunFlyWheelContinuous());
57 toggleGear
= new JoystickButton(leftJoystick
,
58 Constants
.OI
.TOGGLE_GEAR_PORT
);
59 toggleGear
.whenPressed(new ToggleGear());
61 runIntake
= new JoystickButton(leftJoystick
, Constants
.OI
.RUN_INTAKE_PORT
);
62 runIntake
.whileHeld(new RunIntakeContinuous());
64 reverseIntake
= new JoystickButton(leftJoystick
,
65 Constants
.OI
.REVERSE_INTAKE_PORT
);
66 reverseIntake
.whileHeld(new ReverseIntakeContinuous());
68 toggleWinch
= new JoystickButton(leftJoystick
,
69 Constants
.OI
.TOGGLE_WINCH_PORT
);
70 toggleWinch
.whenPressed(new ToggleWinch());
72 increaseShooterSpeed
= new JoystickButton(leftJoystick
,
73 Constants
.OI
.INCREASE_SHOOTER_SPEED_PORT
);
74 increaseShooterSpeed
.whenPressed(new IncreaseShootingSpeed());
76 decreaseShooterSpeed
= new JoystickButton(leftJoystick
,
77 Constants
.OI
.DECREASE_SHOOTER_SPEED_PORT
);
78 decreaseShooterSpeed
.whenPressed(new DecreaseShootingSpeed());
80 changeCam
= new JoystickButton(rightJoystick
,
81 Constants
.OI
.CHANGE_CAMERA_VIEW
);
82 changeCam
.toggleWhenPressed(new ChangeCameraView());
85 public static OI
getOI() {
92 public void keyTyped(KeyEvent e
) {
97 public void keyPressed(KeyEvent e
) {
98 // TODO Auto-generated method stub
103 public void keyReleased(KeyEvent e
) {
104 // TODO Auto-generated method stub