Click or drag to resize

ReInputControllerHelper Class

Provides access to all controller-related members.
Inheritance Hierarchy
SystemObject
  CodeHelper
    RewiredReInputControllerHelper

Namespace: Rewired
Assembly: Rewired_Core (in Rewired_Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public sealed class ControllerHelper : CodeHelper

The ReInputControllerHelper type exposes the following members.

Properties
 NameDescription
Public propertycontrollerCount The number of controllers of all types currently connected.
Public propertyControllers Gets a collection of connected controllers of all types.
Public propertycustomControllerCount The number of custom controllers
Public propertyCustomControllers Get a collection of connected custom controllers.
Public propertyjoystickCount The number of joysticks currently connected.
Public propertyJoysticks Get a collection of connected joysticks.
Public propertyKeyboard Gets the primary Keyboard controller.
Public propertykeyboardEnabled Enabled or disables keyboard input processing. Disabling keyboard input can improve performance on mobile devices. Also useful for joystick games on Android where certain joystick buttons return keyboard keycodes. Disabling keyboard input on Android will still allow certain keyboard keys to return values if triggered by a button press on a joystick, but no keyboard maps will ever be processed.
Obsolete
Public propertyMouse Gets the primary Mouse controller.
Top
Methods
 NameDescription
Public methodAddLastActiveControllerChangedDelegate(ActiveControllerChangedDelegate) Add a delegate to receive a callback every time the last active controller changes.
Public methodAddLastActiveControllerChangedDelegate(ActiveControllerChangedDelegate, ControllerType) Add a delegate to receive a callback every time the last active controller of a specific type changes.
Public methodAutoAssignJoystick Auto-assigns a Joystick to a Player based on the joystick auto-assignment settings in the Rewired Input Manager. If the Joystick is already assigned to a Player, the Joystick will not be re-assigned.
Public methodAutoAssignJoysticks Auto-assigns all unassigned Joysticks to Players based on the joystick auto-assignment settings in the Rewired Input Manager.
Public methodClearLastActiveControllerChangedDelegates Remove all delegates to no longer receive any callbacks when the last active controller changes.
Public methodCreateCustomController(Int32) Create a new CustomController object from a source definition in the Rewired Input Manager.
Public methodCreateCustomController(Int32, String) Create a new CustomController object from a source definition in the Rewired Input Manager.
Public methodCustomControllersWithSourceId Enumerates all CustomControllers with a matching source id.
Public methodCustomControllersWithTag Enumerates all CustomControllers with a matching tag.
Public methodDestroyCustomController Destroys a CustomController.
Public methodGetAnyButton Get the button held state of all buttons on all controllers. Returns TRUE if any button is held. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetAnyButton(ControllerType) Get the button held state of all buttons on all controllers of a specified type. Returns TRUE if any button is held. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetAnyButtonChanged Returns true if any button has changed state from the previous frame to the current. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetAnyButtonChanged(ControllerType) Returns true if any button has changed state from the previous frame to the current. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetAnyButtonDown Get the button just pressed state of all buttons on all controllers. This will only return TRUE only on the first frame a button is pressed. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetAnyButtonDown(ControllerType) Get the button just pressed state of all buttons on all controllers of a specified type. This will only return TRUE only on the first frame a button is pressed. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetAnyButtonPrev Get the previous button held state of all buttons on all controllers. Returns TRUE if any button was held in the previous frame. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetAnyButtonPrev(ControllerType) Get the previous button held state of all buttons on all controllers of a specified type. Returns TRUE if any button was held in the previous frame. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetAnyButtonUp Get the button just released state of all buttons on all controllers of a specified type. This will only return TRUE only on the first frame a button is released. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetAnyButtonUp(ControllerType) Get the button just released state of all buttons on all controllers of a specified type. This will only return TRUE only on the first frame a button is released. This retrieves the value from the actual hardware buttons, not Actions as mapped by Controller Maps in Player.
Public methodGetController(ControllerIdentifier) Gets a controller that matches a Controller Idnetifier.
Public methodGetController(ControllerType, Int32) Gets a controller of a specific type with a specific id.
Public methodGetControllerT(Int32) Gets a controller of type by id.
Public methodGetControllerCount Gets the number of controllers that exist of a specific type.
Public methodGetControllerNames Get an array of connected controller names. Allocates an array, so use sparingly to reduce garbage collection.
Public methodGetControllers Get a collection of connected controllers. Allocates an array, so use sparingly to reduce garbage collection.
Public methodGetControllerTemplatesTInterface Gets a list of all Controller Templates in connected Controllers that match the type.
Public methodGetCustomController Gets a specific custom controller
Public methodGetCustomControllerNames Get an array of connected custom controller names. Allocates an array, so use sparingly to reduce garbage collection.
Public methodGetCustomControllers Get a collection of connected custom controllers. Allocates an array, so use sparingly to reduce garbage collection.
Public methodGetFirstCustomControllerWithSourceId Finds the first CustomController that has a matching source id.
Public methodGetFirstCustomControllerWithTag Finds the first CustomController that has a matching tag.
Public methodGetJoystick Gets a specific joystick.
Public methodGetJoystickNames Gets an array of connected joystick names. Allocates an array, so use sparingly to reduce garbage collection.
Public methodGetJoysticks Gets a collection of connected joysticks. Allocates an array, so use sparingly to reduce garbage collection.
Public methodGetLastActiveController Get the last controller that produced input. If there is no last active controller, the Keyboard will be returned.
Public methodGetLastActiveController(ControllerType) Get the last controller that produced input. If there is no last active controller of the specified type, the return value will be null.
Public methodGetLastActiveControllerT Get the last controller that produced input. If there is no last active controller of the specified type, the return value will be null.
Public methodGetLastActiveControllerType Get the controller type of the last controllerthat produced input. If there is no last active controller, ControllerType.Keyboard is returned.
Public methodGetUnityJoystickIdFromAnyButtonOrAxisPress Returns the 0 based id of the Unity joystick whose button or axis was pressed. -1 if no button or axis was pressed on any joystick. Use this to identify joysticks when using Unity's input system. This has no effect if Unity Input is not handling input on the current platform.
Public methodGetUnityJoystickIdFromAnyButtonPress Returns the 0 based id of the Unity joystick whose button was pressed. -1 if no button was pressed on any joystick. Use this to identify joysticks when using Unity's input system. This has no effect if Unity Input is not handling input on the current platform.
Public methodIsControllerAssigned(ControllerType, Controller) Is the specified controller assigned to any players?
Public methodIsControllerAssigned(ControllerType, Int32) Is the specified controller assigned to any players?
Public methodIsControllerAssignedToPlayer Is the specified controller assigned to the specified player?
Public methodIsCustomControllerAssigned(CustomController) Is a specific Custom Controller assigned to any players?
Public methodIsCustomControllerAssigned(Int32) Is a specific Custom Controller assigned to any players?
Public methodIsCustomControllerAssignedToPlayer Is a specific Custom Controller assigned to a specific player?
Public methodIsJoystickAssigned(Int32) Is a specific Joystick assigned to any players?
Public methodIsJoystickAssigned(Joystick) Is a specific Joystick assigned to any players?
Public methodIsJoystickAssignedToPlayer Is a specific Joystick assigned to a specific player?
Public methodRemoveControllerFromAllPlayers(Controller, Boolean) De-assigns the specified controller from all players.
Public methodRemoveControllerFromAllPlayers(ControllerType, Int32, Boolean) De-assigns the specified controller from all players.
Public methodRemoveCustomControllerFromAllPlayers(CustomController, Boolean) De-assigns a specific Custom Controller from all Players
Public methodRemoveCustomControllerFromAllPlayers(Int32, Boolean) De-assigns a specific Custom Controller from all Players
Public methodRemoveJoystickFromAllPlayers(Int32, Boolean) De-assigns a specific Joystick from all Players
Public methodRemoveJoystickFromAllPlayers(Joystick, Boolean) De-assigns a specific Joystick from all Players
Public methodRemoveLastActiveControllerChangedDelegate(ActiveControllerChangedDelegate) Remove a delegate to no longer receive callbacks when the last active controller changes.
Public methodRemoveLastActiveControllerChangedDelegate(ActiveControllerChangedDelegate, ControllerType) Remove a delegate to no longer receive callbacks when the last active controller of a specific type changes.
Public methodSetUnityJoystickId Sets a Unity joystick as the input source of a Joystick. Use this to remap a joystick to its source when reconnected on platforms that use Unity Input. This has no effect if Unity Input is not handling input on the current platform.
Public methodSetUnityJoystickIdFromAnyButtonOrAxisPress Sets a Unity joystick as the input source of a Joystick. The first Unity joystick that returns a button or axis press will be assigned to the Joystick. While no buttons or axes are pressed, this will return False. When a press is detected, it will return True and assign the joystick id.
Public methodSetUnityJoystickIdFromAnyButtonPress Sets a Unity joystick as the input source of a Joystick. The first Unity joystick that returns a button press will be assigned to the Joystick. While no buttons are pressed, this will return False. When a button press is detected, it will return True and assign the joystick id.
Top
Fields
 NameDescription
Public fieldconflictChecking Provides access to Controller Map conflict checking-related members.
Public fieldpolling Provides access to controller element polling-related members. This should only be used for controller mapping or other non-gameplay-related code. The polling system is expensive and should not be used during gameplay.
Top
See Also