Package edu.wpi.first.wpilibj.simulation
Class XboxControllerSim
- java.lang.Object
-
- edu.wpi.first.wpilibj.simulation.GenericHIDSim
-
- edu.wpi.first.wpilibj.simulation.XboxControllerSim
-
public class XboxControllerSim extends GenericHIDSim
Class to control a simulated Xbox 360 or Xbox One controller.
-
-
Field Summary
-
Fields inherited from class edu.wpi.first.wpilibj.simulation.GenericHIDSim
m_port
-
-
Constructor Summary
Constructors Constructor Description XboxControllerSim(int port)
Constructs from a joystick port number.XboxControllerSim(XboxController joystick)
Constructs from a XboxController object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setAButton(boolean state)
Change the value of the A button.void
setBackButton(boolean state)
Change the value of the Back button.void
setBButton(boolean state)
Change the value of the B button.void
setLeftBumper(boolean state)
Change the value of the left bumper on the joystick.void
setLeftStickButton(boolean state)
Change the value of the left stick button on the joystick.void
setLeftTriggerAxis(double value)
Change the value of the left trigger axis on the joystick.void
setLeftX(double value)
Change the left X value of the joystick.void
setLeftY(double value)
Change the left Y value of the joystick.void
setRightBumper(boolean state)
Change the value of the right bumper on the joystick.void
setRightStickButton(boolean state)
Change the value of the right stick button on the joystick.void
setRightTriggerAxis(double value)
Change the value of the right trigger axis on the joystick.void
setRightX(double value)
Change the right X value of the joystick.void
setRightY(double value)
Change the right Y value of the joystick.void
setStartButton(boolean state)
Change the value of the Start button.void
setXButton(boolean state)
Change the value of the X button.void
setYButton(boolean state)
Change the value of the Y button.-
Methods inherited from class edu.wpi.first.wpilibj.simulation.GenericHIDSim
getOutput, getOutputs, getRumble, notifyNewData, setAxisCount, setAxisType, setButtonCount, setName, setPOV, setPOV, setPOVCount, setRawAxis, setRawButton, setType
-
-
-
-
Constructor Detail
-
XboxControllerSim
public XboxControllerSim(XboxController joystick)
Constructs from a XboxController object.- Parameters:
joystick
- controller to simulate
-
XboxControllerSim
public XboxControllerSim(int port)
Constructs from a joystick port number.- Parameters:
port
- port number
-
-
Method Detail
-
setLeftX
public void setLeftX(double value)
Change the left X value of the joystick.- Parameters:
value
- the new value
-
setRightX
public void setRightX(double value)
Change the right X value of the joystick.- Parameters:
value
- the new value
-
setLeftY
public void setLeftY(double value)
Change the left Y value of the joystick.- Parameters:
value
- the new value
-
setRightY
public void setRightY(double value)
Change the right Y value of the joystick.- Parameters:
value
- the new value
-
setLeftTriggerAxis
public void setLeftTriggerAxis(double value)
Change the value of the left trigger axis on the joystick.- Parameters:
value
- the new value
-
setRightTriggerAxis
public void setRightTriggerAxis(double value)
Change the value of the right trigger axis on the joystick.- Parameters:
value
- the new value
-
setLeftBumper
public void setLeftBumper(boolean state)
Change the value of the left bumper on the joystick.- Parameters:
state
- the new value
-
setRightBumper
public void setRightBumper(boolean state)
Change the value of the right bumper on the joystick.- Parameters:
state
- the new value
-
setLeftStickButton
public void setLeftStickButton(boolean state)
Change the value of the left stick button on the joystick.- Parameters:
state
- the new value
-
setRightStickButton
public void setRightStickButton(boolean state)
Change the value of the right stick button on the joystick.- Parameters:
state
- the new value
-
setAButton
public void setAButton(boolean state)
Change the value of the A button.- Parameters:
state
- the new value
-
setBButton
public void setBButton(boolean state)
Change the value of the B button.- Parameters:
state
- the new value
-
setXButton
public void setXButton(boolean state)
Change the value of the X button.- Parameters:
state
- the new value
-
setYButton
public void setYButton(boolean state)
Change the value of the Y button.- Parameters:
state
- the new value
-
setBackButton
public void setBackButton(boolean state)
Change the value of the Back button.- Parameters:
state
- the new value
-
setStartButton
public void setStartButton(boolean state)
Change the value of the Start button.- Parameters:
state
- the new value
-
-