Class GamepadSim
java.lang.Object
org.wpilib.simulation.GenericHIDSim
org.wpilib.simulation.GamepadSim
Class to control a simulated Gamepad controller.
-
Field Summary
Fields inherited from class GenericHIDSim
m_port -
Constructor Summary
ConstructorsConstructorDescriptionGamepadSim(int port) Constructs from a joystick port number.GamepadSim(Gamepad joystick) Constructs from a Gamepad object. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAxis(Gamepad.Axis axis, double value) Set the value of a given axis.voidsetBackButton(boolean value) Change the value of the Back button on the controller.voidsetButton(Gamepad.Button button, boolean value) Set the value of a given button.voidsetDpadDownButton(boolean value) Change the value of the D-pad down button on the controller.voidsetDpadLeftButton(boolean value) Change the value of the D-pad left button on the controller.voidsetDpadRightButton(boolean value) Change the value of the D-pad right button on the controller.voidsetDpadUpButton(boolean value) Change the value of the D-pad up button on the controller.voidsetFaceDownButton(boolean value) Change the value of the Face Down button on the controller.voidsetFaceLeftButton(boolean value) Change the value of the Face Left button on the controller.voidsetFaceRightButton(boolean value) Change the value of the Face Right button on the controller.voidsetFaceUpButton(boolean value) Change the value of the Face Up button on the controller.voidsetGuideButton(boolean value) Change the value of the Guide button on the controller.voidsetLeftBumperButton(boolean value) Change the value of the right bumper button on the controller.voidsetLeftPaddle1Button(boolean value) Change the value of the Left Paddle 1 button on the controller.voidsetLeftPaddle2Button(boolean value) Change the value of the Left Paddle 2 button on the controller.voidsetLeftStickButton(boolean value) Change the value of the left stick button on the controller.voidsetLeftTriggerAxis(double value) Change the value of the left trigger axis on the controller.voidsetLeftX(double value) Change the left X value of the controller's joystick.voidsetLeftY(double value) Change the left Y value of the controller's joystick.voidsetMisc1Button(boolean value) Change the value of the Miscellaneous 1 button on the controller.voidsetMisc2Button(boolean value) Change the value of the Miscellaneous 2 button on the controller.voidsetMisc3Button(boolean value) Change the value of the Miscellaneous 3 button on the controller.voidsetMisc4Button(boolean value) Change the value of the Miscellaneous 4 button on the controller.voidsetMisc5Button(boolean value) Change the value of the Miscellaneous 5 button on the controller.voidsetMisc6Button(boolean value) Change the value of the Miscellaneous 6 button on the controller.voidsetRightBumperButton(boolean value) Change the value of the right bumper button on the controller.voidsetRightPaddle1Button(boolean value) Change the value of the Right Paddle 1 button on the controller.voidsetRightPaddle2Button(boolean value) Change the value of the Right Paddle 2 button on the controller.voidsetRightStickButton(boolean value) Change the value of the right stick button on the controller.voidsetRightTriggerAxis(double value) Change the value of the right trigger axis on the controller.voidsetRightX(double value) Change the right X value of the controller's joystick.voidsetRightY(double value) Change the right Y value of the controller's joystick.voidsetStartButton(boolean value) Change the value of the Start button on the controller.voidsetTouchpadButton(boolean value) Change the value of the Touchpad button on the controller.Methods inherited from class GenericHIDSim
getLeds, getRumble, notifyNewData, setAxesAvailable, setAxesMaximumIndex, setButtonsAvailable, setButtonsMaximumIndex, setGamepadType, setName, setPOV, setPOV, setPOVsAvailable, setPOVsMaximumIndex, setRawAxis, setRawButton, setSupportedOutputs
-
Constructor Details
-
GamepadSim
Constructs from a Gamepad object.- Parameters:
joystick- controller to simulate
-
GamepadSim
public GamepadSim(int port) Constructs from a joystick port number.- Parameters:
port- port number
-
-
Method Details
-
setButton
Set the value of a given button.- Parameters:
button- the button to setvalue- the new value
-
setAxis
Set the value of a given axis.- Parameters:
axis- the axis to setvalue- the new value
-
setLeftX
public void setLeftX(double value) Change the left X value of the controller's joystick.- Parameters:
value- the new value
-
setLeftY
public void setLeftY(double value) Change the left Y value of the controller's joystick.- Parameters:
value- the new value
-
setRightX
public void setRightX(double value) Change the right X value of the controller's joystick.- Parameters:
value- the new value
-
setRightY
public void setRightY(double value) Change the right Y value of the controller's joystick.- Parameters:
value- the new value
-
setLeftTriggerAxis
public void setLeftTriggerAxis(double value) Change the value of the left trigger axis on the controller.- Parameters:
value- the new value
-
setRightTriggerAxis
public void setRightTriggerAxis(double value) Change the value of the right trigger axis on the controller.- Parameters:
value- the new value
-
setFaceDownButton
public void setFaceDownButton(boolean value) Change the value of the Face Down button on the controller.- Parameters:
value- the new value
-
setFaceRightButton
public void setFaceRightButton(boolean value) Change the value of the Face Right button on the controller.- Parameters:
value- the new value
-
setFaceLeftButton
public void setFaceLeftButton(boolean value) Change the value of the Face Left button on the controller.- Parameters:
value- the new value
-
setFaceUpButton
public void setFaceUpButton(boolean value) Change the value of the Face Up button on the controller.- Parameters:
value- the new value
-
setBackButton
public void setBackButton(boolean value) Change the value of the Back button on the controller.- Parameters:
value- the new value
-
setGuideButton
public void setGuideButton(boolean value) Change the value of the Guide button on the controller.- Parameters:
value- the new value
-
setStartButton
public void setStartButton(boolean value) Change the value of the Start button on the controller.- Parameters:
value- the new value
-
setLeftStickButton
public void setLeftStickButton(boolean value) Change the value of the left stick button on the controller.- Parameters:
value- the new value
-
setRightStickButton
public void setRightStickButton(boolean value) Change the value of the right stick button on the controller.- Parameters:
value- the new value
-
setLeftBumperButton
public void setLeftBumperButton(boolean value) Change the value of the right bumper button on the controller.- Parameters:
value- the new value
-
setRightBumperButton
public void setRightBumperButton(boolean value) Change the value of the right bumper button on the controller.- Parameters:
value- the new value
-
setDpadUpButton
public void setDpadUpButton(boolean value) Change the value of the D-pad up button on the controller.- Parameters:
value- the new value
-
setDpadDownButton
public void setDpadDownButton(boolean value) Change the value of the D-pad down button on the controller.- Parameters:
value- the new value
-
setDpadLeftButton
public void setDpadLeftButton(boolean value) Change the value of the D-pad left button on the controller.- Parameters:
value- the new value
-
setDpadRightButton
public void setDpadRightButton(boolean value) Change the value of the D-pad right button on the controller.- Parameters:
value- the new value
-
setMisc1Button
public void setMisc1Button(boolean value) Change the value of the Miscellaneous 1 button on the controller.- Parameters:
value- the new value
-
setRightPaddle1Button
public void setRightPaddle1Button(boolean value) Change the value of the Right Paddle 1 button on the controller.- Parameters:
value- the new value
-
setLeftPaddle1Button
public void setLeftPaddle1Button(boolean value) Change the value of the Left Paddle 1 button on the controller.- Parameters:
value- the new value
-
setRightPaddle2Button
public void setRightPaddle2Button(boolean value) Change the value of the Right Paddle 2 button on the controller.- Parameters:
value- the new value
-
setLeftPaddle2Button
public void setLeftPaddle2Button(boolean value) Change the value of the Left Paddle 2 button on the controller.- Parameters:
value- the new value
-
setTouchpadButton
public void setTouchpadButton(boolean value) Change the value of the Touchpad button on the controller.- Parameters:
value- the new value
-
setMisc2Button
public void setMisc2Button(boolean value) Change the value of the Miscellaneous 2 button on the controller.- Parameters:
value- the new value
-
setMisc3Button
public void setMisc3Button(boolean value) Change the value of the Miscellaneous 3 button on the controller.- Parameters:
value- the new value
-
setMisc4Button
public void setMisc4Button(boolean value) Change the value of the Miscellaneous 4 button on the controller.- Parameters:
value- the new value
-
setMisc5Button
public void setMisc5Button(boolean value) Change the value of the Miscellaneous 5 button on the controller.- Parameters:
value- the new value
-
setMisc6Button
public void setMisc6Button(boolean value) Change the value of the Miscellaneous 6 button on the controller.- Parameters:
value- the new value
-