Rewired
Controller
Hardware
Getting a Controller
(To get a specific controller)
ReInput.controllers.GetController
player.controllers.GetController
player.controllers.GetControllerWithTag
(To get the mouse from)
(To get the keyboard from)
(Loop through all controllers)
(Loop through controllers assigned to a Player)
Receiving joystick connect and disconnect events
ReInput.ControllerConnectedEvent
Receive an event when a controller is connected, register for
ReInput.ControllerPreDisconnectEvent
Receive an event when a controller is about to be disconnected, register for
ReInput.ControllerDisconnectedEvent
Receive an event when a controller is fully disconnected, register for
Assigning joysticks to players
Player class
ReInput class
Software
Enabling and disabling controller maps
//Controller Maps can be enabled or disabled at will via scripting. This can be useful if you want to change game modes and have a different set of controls become active. For example, opening a menu screen. Controller Maps are stored in the Player class.
player.controllers.maps.SetAllMapsEnabled
//Set enabled state on all maps owned by the Player or all maps for a specific controller type
player.controllers.maps.SetMapsEnabled
//Set enabled state on a group of maps owned by the Player by controller type, category, and layout
//You can also enable and disable maps one by one by accessing the maps through Playe
// Disabled maps will not contribute to input.
Once you have the map, enable or disable it by setting controllerMap.enabled = true or controllerMap.enabled = false
player.controllers.maps.GetMap
player.controllers.maps.GetMaps
player.controllers.maps.GetAllMaps
player.controllers.maps.GetAllMapsInCategory
(init)
Calibrating controller axes
Creating a controller mapping screen
Saving and loading maps
controller
calibration
(runtime)
Modifying Input Behaviors during runtime
Creating on-screen touch controllers
(advanced)
Creating new controller definitions
Creating new controller templates
Adding a controller to an existing controller template
Identifying joysticks on fallback platforms
At game start, pop up a GUI asking the user to press a button on each named controller.
When the user presses the button, set the joystick id on the joystick so Rewired can identify which joystick it is.
Repeat the above steps for each joystick in the system.
Any time a joystick is connected or disconnected, repeat the whole identification process for every joystick.
Input Manager
Rewired Editor
Settings
//The Settings page allows you change the options for the current Input Manager.
Update Loop
Input Sources
Joystick Auto-Assignment
Players
Players
Actions
Input Behaviors
Map Categories
Action Categories
Custom Controllers
Joystick Layouts
Keyboard Layouts
Mouse Layouts
Custom Controller Layouts
Joystick Maps
Keyboard Maps
Mouse Maps
Custom Controller Maps
Getting a Player
ReInput.players.GetPlayer
Input
Actions
//An Action can be any type of event that takes place as a result of input
//You can also get input based on the Action Id instead of by name if you choose
//The Action Id is displayed in the Rewired Editor under Actions.
ex:
(char)
(sys)
(Input Behaviour)
(Getting Input)
Polling
Event
Controller
//A third method would be to get input directly from a controller's buttons and axes. This is generally not a good choice as you will lose all the advantages of the player-centric system including mapping.