Joystick Class |
Namespace: Rewired
public class Joystick : ControllerWithAxes
The Joystick type exposes the following members.
Name | Description | |
---|---|---|
Axes |
List of axes in this controller.
(Inherited from ControllerWithAxes.) | |
Axes2D |
List of Axis2Ds in this controller.
(Inherited from ControllerWithAxes.) | |
axis2DCount |
The Axis2D count in the controller.
(Inherited from ControllerWithAxes.) | |
axisCount |
The axis count in the controller.
(Inherited from ControllerWithAxes.) | |
AxisElementIdentifiers |
Gets a list of all Axis element identifiers.
There is always one element identifier per Axis
which is at the same index as the corresponding Axis.
(Inherited from ControllerWithAxes.) | |
buttonCount |
The Button count in the controller.
(Inherited from Controller.) | |
ButtonElementIdentifiers |
Gets a list of all Button element identifiers.
There is always one element identifier per Button
which is at the same index as the corresponding Button.
(Inherited from Controller.) | |
Buttons |
List of Buttons in this controller.
(Inherited from Controller.) | |
calibrationMap |
The Calibration Map in this controller.
(Inherited from ControllerWithAxes.) | |
CompoundElements |
List of all Compound Elements in this controller.
(Inherited from Controller.) | |
deviceInstanceGuid |
The unique persistent instance GUID of this device.
This is an id generated for the device that may stay constant between application sessions and system restarts.
This can be used for device assignment persistence between runs. The specific platform and input sources in use
affects the reliability of this value for device assignment persistence.
A value of Guid.Empty means the device or input source has no reliable unique identifier so persistant assignment
isn't possible using this value. Even if a Guid is provided, reliability when multiple identical controllers are
attached depends greatly on the platform and input source(s) currently in use.
(Overrides ControllerdeviceInstanceGuid.) | |
directionalPadCount |
The number of D-Pads in this controller.
| |
DirectionalPads |
List of D-Pads in this controller.
| |
elementCount |
The Element count in the controller.
(Inherited from Controller.) | |
ElementIdentifiers |
Gets a list of all element identifiers of all types.
(Inherited from Controller.) | |
Elements |
List of all Elements in this controller.
(Inherited from Controller.) | |
enabled |
Is the controller enabled? Disabled controllers return no input.
(Inherited from Controller.) | |
extension |
Gets an object used to access controller and platform-specific controller functions.
(Inherited from Controller.) | |
hardwareIdentifier |
String of information from the controller used for identifying unknown controller maps for saving/loading.
(Inherited from Controller.) | |
hardwareName |
The name the controller hardware returns.
(Inherited from Controller.) | |
hardwareTypeGuid |
The Rewired GUID associated with this device. A GUID of all zeros is an Unknown Controller.
(Inherited from Controller.) | |
hatCount |
The number of Hats in this controller.
| |
Hats |
List of Hats in this controller.
| |
identifier |
Gets identifying information about the Controller.
(Inherited from Controller.) | |
isConnected |
Is the controller connected?
(Inherited from Controller.) | |
mapTypeString |
String representation of the controller map type. Can be used for saving/loading.
(Inherited from Controller.) | |
name |
The name of the controller.
This is drawn from the controller definition for recognized controllers.
For unrecognized controllers, the name returned by the hardware is used instead.
The returned value will be localized if localization is in use.
(Inherited from Controller.) | |
supportsVibration |
Does this controller support vibration?
| |
systemId |
The id of the device in the underlying input source. The meaning of this value is determined by the current input source.
This may include Unity input, Raw Input, Direct Input, OSX I/O Kit, XBoxOneInput, Ouya input, and others.
Generally, you should never need to use this, but it is exposed for advanced uses.
Returns null if there is no system id associated with this joystick.
| |
tag |
The tag assigned to the controller. Can be used for find a controller by tag.
(Inherited from Controller.) | |
templateCount |
The Template count in the controller.
(Inherited from Controller.) | |
Templates |
The Controller Templates that the Controller implements.
(Inherited from Controller.) | |
type |
The type of this controller.
(Inherited from Controller.) | |
unityId |
The unity joystick id of this joystick. This value is only used on platforms that use Unity input as the underlying input source.
This value is a 1-based index corresponding to the joystick number in the Unity input manager.
Generally, you should never need to use this, but it is exposed for advanced uses.
Returns 0 if the platform does not use Unity input or if the joystick is not associated with a Unity joystick.
| |
vibrationLeftMotor |
Sets vibration speed on the left motor or the motor at index 0. [float: 0.0 - 1.0]
This is specifically for XInput controllers on Windows.
| |
vibrationMotorCount |
The number of vibration motors this device supports.
| |
vibrationRightMotor |
Sets vibration speed on the right motor or the motor at index 1. [float: 0.0 - 1.0]
This is specifically for XInput controllers on Windows.
|
Name | Description | |
---|---|---|
GetAnyButton |
Gets the button held state of any hardware button. This will return TRUE as long as any button is held.
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetAnyButtonChanged |
Returns true if any button has changed state from the previous frame to the current.
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetAnyButtonDown |
Gets the button just pressed state of any hardware button. This will only return TRUE only on the first frame the button is pressed
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetAnyButtonPrev |
Gets the previous button held state of any hardware button. This will return TRUE if any button was held in the previous frame.
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetAnyButtonUp |
Gets the button just released state of any hardware button. This will only return TRUE only on the first frame the button is released
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetAxis |
Gets the current axis value.
(Inherited from ControllerWithAxes.) | |
GetAxis2D |
Gets the current 2D axis value.
(Inherited from ControllerWithAxes.) | |
GetAxis2DPrev |
Gets the 2D axis value from the previous frame.
(Inherited from ControllerWithAxes.) | |
GetAxis2DRaw |
Gets the current raw 2D axis value. Excludes calibration.
(Inherited from ControllerWithAxes.) | |
GetAxis2DRawPrev |
Gets the raw 2D axis value from the previous frame.. Excludes calibration.
(Inherited from ControllerWithAxes.) | |
GetAxisById |
Gets the current axis value.
(Inherited from ControllerWithAxes.) | |
GetAxisIndexById |
Gets the index of the Axis with the specified element idenfitier id.
(Inherited from ControllerWithAxes.) | |
GetAxisLastTimeActive | (Inherited from ControllerWithAxes.) | |
GetAxisLastTimeActiveById | (Inherited from ControllerWithAxes.) | |
GetAxisLastTimeInactive | (Inherited from ControllerWithAxes.) | |
GetAxisLastTimeInactiveById | (Inherited from ControllerWithAxes.) | |
GetAxisPrev |
Gets the axis value from the previous frame.
(Inherited from ControllerWithAxes.) | |
GetAxisPrevById |
Gets the axis value from the previous frame.
(Inherited from ControllerWithAxes.) | |
GetAxisRaw |
Gets the current raw axis value. Excludes calibration.
(Inherited from ControllerWithAxes.) | |
GetAxisRawById |
Gets the current raw axis value. Excludes calibration.
(Inherited from ControllerWithAxes.) | |
GetAxisRawLastTimeActive | (Inherited from ControllerWithAxes.) | |
GetAxisRawLastTimeActiveById | (Inherited from ControllerWithAxes.) | |
GetAxisRawLastTimeInactive | (Inherited from ControllerWithAxes.) | |
GetAxisRawLastTimeInactiveById | (Inherited from ControllerWithAxes.) | |
GetAxisRawPrev |
Gets the raw axis value from the previous frame.. Excludes calibration.
(Inherited from ControllerWithAxes.) | |
GetAxisRawPrevById |
Gets the raw axis value from the previous frame.. Excludes calibration.
(Inherited from ControllerWithAxes.) | |
GetAxisRawTimeActive | (Inherited from ControllerWithAxes.) | |
GetAxisRawTimeActiveById | (Inherited from ControllerWithAxes.) | |
GetAxisRawTimeInactive | (Inherited from ControllerWithAxes.) | |
GetAxisRawTimeInactiveById | (Inherited from ControllerWithAxes.) | |
GetAxisTimeActive | (Inherited from ControllerWithAxes.) | |
GetAxisTimeActiveById | (Inherited from ControllerWithAxes.) | |
GetAxisTimeInactive | (Inherited from ControllerWithAxes.) | |
GetAxisTimeInactiveById | (Inherited from ControllerWithAxes.) | |
GetButton |
Gets the button held state of the hardware button at the specified index. This will return TRUE as long as the button is held.
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetButtonById |
Gets the button held state of the hardware button at the specified element identifier id. This will return TRUE as long as the button is held.
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetButtonChanged |
Returns true if the button has changed state from the previous frame to the current.
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetButtonDoublePressDown(Int32) |
Gets the double press down state of the button at the specified index.
This will return TRUE only on the first frame the double press is detected.
This will use the default double press speed.
(Inherited from Controller.) | |
GetButtonDoublePressDown(Int32, Single) |
Gets the double press down state of the button at the specified index.
This will return TRUE only on the first frame the double press is detected.
(Inherited from Controller.) | |
GetButtonDoublePressDownById(Int32) |
Gets the double press down state of the button at the specified element identifier id.
This will return TRUE only on the first frame the double press is detected.
This will use the default double press speed.
(Inherited from Controller.) | |
GetButtonDoublePressDownById(Int32, Single) |
Gets the double press down state of the button at the specified element identifier id.
This will return TRUE only on the first frame the double press is detected.
(Inherited from Controller.) | |
GetButtonDoublePressHold(Int32) |
Gets the double press and hold state of the button at the specified index.
This will return TRUE after the double press is detected and for as long as the button is held thereafter.
This will use the default double press speed.
(Inherited from Controller.) | |
GetButtonDoublePressHold(Int32, Single) |
Gets the double press and hold state of the button at the specified index.
This will return TRUE after the double press is detected and for as long as the button is held thereafter.
(Inherited from Controller.) | |
GetButtonDoublePressHoldById(Int32) |
Gets the double press and hold state of the button at the specified element identifier id.
This will return TRUE after the double press is detected and for as long as the button is held thereafter.
This will use the default double press speed.
(Inherited from Controller.) | |
GetButtonDoublePressHoldById(Int32, Single) |
Gets the double press and hold state of the button at the specified element identifier id.
This will return TRUE after the double press is detected and for as long as the button is held thereafter.
(Inherited from Controller.) | |
GetButtonDown |
Gets the button just pressed state of the hardware button at the specified index. This will only return TRUE only on the first frame the button is pressed
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetButtonDownById |
Gets the button just pressed state of the hardware button at the specified element identifier id. This will only return TRUE only on the first frame the button is pressed
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetButtonIndexById |
Gets the index of the Button with the specified element idenfitier id.
(Inherited from Controller.) | |
GetButtonLastTimePressed |
Gets the last timestamp the button at index was active.
(Inherited from Controller.) | |
GetButtonLastTimePressedById |
Gets the last timestamp the button with the element identifier id was active.
(Inherited from Controller.) | |
GetButtonLastTimeUnpressed |
Gets the last timestamp the button at index was inactive.
(Inherited from Controller.) | |
GetButtonLastTimeUnpressedById |
Gets the last timestamp the button with the element identifier id was inactive.
(Inherited from Controller.) | |
GetButtonPrev |
Gets the previous button held state of the hardware button at the specified index. This will return TRUE if the button was held in the previous frame.
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetButtonPrevById |
Gets the previous button held state of the hardware button at the specified element identifier id. This will return TRUE if the button was held in the previous frame.
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetButtonTimePressed |
Gets the length of time the button at index has been active.
(Inherited from Controller.) | |
GetButtonTimePressedById |
Gets the length of time the button with the element identifier id has been active.
(Inherited from Controller.) | |
GetButtonTimeUnpressed |
Gets the length of time the button at index has been inactive.
(Inherited from Controller.) | |
GetButtonTimeUnpressedById |
Gets the length of time the button with the element identifier id has been inactive.
(Inherited from Controller.) | |
GetButtonUp |
Gets the button just released state of the hardware button at the specified index. This will only return TRUE only on the first frame the button is released
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetButtonUpById |
Gets the button just released state of the hardware button at the specified element identifier id. This will only return TRUE only on the first frame the button is released
This does not take into acount any controller mapping or Actions -- this is the unmapped physical button value only.
Use the Player class to get button values mapped to Actions.
(Inherited from Controller.) | |
GetCalibrationMapSaveData |
Gets calibration map save data from this joystick.
| |
GetCompoundElementById |
Gets the Compound Element with the specified element identifier id.
(Inherited from Controller.) | |
GetCompundElementById | Obsolete.
OBSOLETE: This method is deprecated. Use GetCompoundElementById(Int32) instead.
Gets the Compound Element with the specified element identifier id.
(Inherited from Controller.) | |
GetElementById |
Gets the Element with the specified element identifier id.
(Inherited from ControllerWithAxes.) | |
GetElementIdentifierById |
Gets a Controller Element Identifier by id.
(Inherited from Controller.) | |
GetExtensionT |
Gets an object used to access controller and platform-specific controller functions.
(Inherited from Controller.) | |
GetLastTimeActive |
Gets the last timestamp any axis or button was active.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
(Inherited from ControllerWithAxes.) | |
GetLastTimeActive(Boolean) |
Gets the last timestamp any axis or button was active.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
(Inherited from ControllerWithAxes.) | |
GetLastTimeAnyAxisActive |
Gets the last timestamp any axis was active.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
(Inherited from ControllerWithAxes.) | |
GetLastTimeAnyAxisActive(Boolean) |
Gets the last timestamp any axis was active.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
(Inherited from ControllerWithAxes.) | |
GetLastTimeAnyAxisChanged |
Gets the last timestamp any axis changed value.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
(Inherited from ControllerWithAxes.) | |
GetLastTimeAnyAxisChanged(Boolean) |
Gets the last timestamp any axis changed value.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
(Inherited from ControllerWithAxes.) | |
GetLastTimeAnyButtonChanged |
Gets the last timestamp any button's state changed.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
(Inherited from Controller.) | |
GetLastTimeAnyButtonPressed |
Gets the last timestamp any button was active.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
(Inherited from Controller.) | |
GetLastTimeAnyElementChanged |
Gets the last timestamp any element changed state.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
(Inherited from ControllerWithAxes.) | |
GetLastTimeAnyElementChanged(Boolean) |
Gets the last timestamp any element changed state.
NOTE: If comparing time against current time, always compare to ReInput.time.unscaledTime.
Use raw axis values (Inherited from ControllerWithAxes.) | |
GetTemplate(Guid) |
Gets a Controller Template by type GUID.
(Inherited from Controller.) | |
GetTemplate(Type) |
Gets a Controller Template by type.
(Inherited from Controller.) | |
GetTemplateT |
Gets the first Controller Template that implements the specified type.
Note that it is possible to have multiple Controller Templates that implement a specific type of interface
such as IControllerTemplate. You should use the most specific interface type possible such as IDualAnalogGamepadTemplate instead,
which would be guaranteed to only apply to a single Controller Template.
(Inherited from Controller.) | |
GetVibration |
Gets vibration level for a motor at a specified index.
| |
ImplementsTemplate(Guid) |
Determines if the Controller implements a Controller Template by type GUID.
(Inherited from Controller.) | |
ImplementsTemplate(Type) |
Determines if the Controller implements a Controller Template by type.
(Inherited from Controller.) | |
ImplementsTemplateT |
Determines if the Controller implements a Controller Template by type.
(Inherited from Controller.) | |
ImportCalibrationMapFromJsonString |
Imports a Calibration Map from JSON.
(Inherited from ControllerWithAxes.) | |
ImportCalibrationMapFromXmlString |
Imports a Calibration Map from XML.
(Inherited from ControllerWithAxes.) | |
PollForAllAxes | (Inherited from ControllerWithAxes.) | |
PollForAllButtons | (Inherited from Controller.) | |
PollForAllButtonsDown | (Inherited from Controller.) | |
PollForAllElements | (Inherited from ControllerWithAxes.) | |
PollForAllElementsDown | (Inherited from ControllerWithAxes.) | |
PollForFirstAxis | (Inherited from ControllerWithAxes.) | |
PollForFirstButton | (Inherited from Controller.) | |
PollForFirstButtonDown | (Inherited from Controller.) | |
PollForFirstElement | (Inherited from ControllerWithAxes.) | |
PollForFirstElementDown | (Inherited from ControllerWithAxes.) | |
SetVibration(Int32, Single) |
Sets vibration level for a motor at a specified index.
| |
SetVibration(Single, Single) |
Sets vibration level for left and right motors or for the first two motors.
| |
SetVibration(Int32, Single, Boolean) |
Sets vibration level for a motor at a specified index.
| |
SetVibration(Int32, Single, Single) |
Sets vibration level for a motor at a specified index with a timeout.
| |
SetVibration(Int32, Single, Single, Boolean) |
Sets vibration level for a motor at a specified index with a timeout.
| |
SetVibration(Single, Single, Single, Single) |
Sets vibration level for left and right motors or for the first two motors with a timeout.
| |
StopVibration |
Stops vibration on all motors.
|
Name | Description | |
---|---|---|
id |
Rewired unique id of this controller. This is not an index.
The id is unique among controllers of a specific controller type.
(Inherited from Controller.) |