cohtml.InputSystem.GamepadMapper
Abstract class describing the Unity3D Input Manager gamepad mapping to the W3C standard gamepad mapping.
Inherits from cohtml.InputSystem.GamepadBase.GamepadMap
Inherited by cohtml.InputSystem.GamepadMapGeneric, cohtml.InputSystem.GamepadMapWinPS
Public Types
Section titled “Public Types”| Name | |
|---|---|
| enum class | Profile { PlayStation, XBox, Stadia, Other} The supported gamepad mapping profiles. Add a new one or use Other |
| enum class | Platform { Unknown = 0, Windows, Mac, Linux, Android, IOS, Count} Supported OS platforms. When a gamepad from another platform is present, it should be added here. The value Unknown should always be first, and Count should always remain last. |
Protected Types
Section titled “Protected Types”| Name | |
|---|---|
| enum class | JSIndex { South = 0, LeftStickX = 0, East = 1, LeftStickY = 1, West = 2, RightStickX = 2, North = 3, RightStickY = 3, LeftBumper = 4, RightBumper = 5, LeftTrigger = 6, RightTrigger = 7, Select = 8, Start = 9, LeftStickPress = 10, RightStickPress = 11, DPadUp = 12, DPadDown = 13, DPadLeft = 14, DPadRight = 15, System = 16, Extra1 = 17, Extra2 = 18} Buttons and Axes displayed in the correct order in the array according to the W3C standard. Each number corresponds to the index in the array. |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| virtual void | UpdateEntities() Updates the array of buttons and axes based on the mapping. |
Protected Functions
Section titled “Protected Functions”| Name | |
|---|---|
| GamepadMapper(uint id, string name, int buttonsLength =16, int axesLength =4) | |
| string | MapButton(byte button) |
| string | MapAxis(byte axis) |
| virtual void | UpdateButtons() Updates the array of buttons based on the mapping. |
| virtual void | UpdateDPad(string mapX, bool isInvertedX, string mapY, bool isInvertedY) Most D-Pad buttons are mapped to 2 axes, but sometimes they are 4 buttons, sometimes are inverted axes, Provide a way to handle the buttons mapping. |
| virtual void | UpdateValue(float [] array, JSIndex jsIndex, float value) A helper method used by all the above methods to update the value of provided array index. |
Public Properties
Section titled “Public Properties”| Name | |
|---|---|
| abstract Profile | ProfileType |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| const string | CohtmlGamepadStr |
| readonly string | CohtmlGamepadAxisName |
| readonly string | JoystickButtonName |
Protected Attributes
Section titled “Protected Attributes”| Name | |
|---|---|
| Dictionary< JSIndex, string > | m_ButtonsMap |
| Dictionary< JSIndex, string > | m_AxesMap |
| float | m_FloatValue |
| JSIndex | m_JsIndex |
Additional inherited members
Section titled “Additional inherited members”Public Functions inherited from cohtml.InputSystem.GamepadBase.GamepadMap
| Name | |
|---|---|
| GamepadMap(uint id, string name, int buttonsLength, int axesLength) |
Public Attributes inherited from cohtml.InputSystem.GamepadBase.GamepadMap
| Name | |
|---|---|
| uint | Id The identification of the gamepad. |
| string | Name The name of the gamepad. |
| float [] | Buttons An array representing the state of the gamepad buttons. |
| float [] | Axes An array representing the state of the gamepad axes. |
| HashSet< CohtmlUISystem > | RegisteredInSystems A collection storing the CohtmlUISystem’s that registered this gamepad. |
Public Types Documentation
Section titled “Public Types Documentation”enum Profile
Section titled “enum Profile”| Enumerator | Value | Description |
|---|---|---|
| PlayStation | ||
| XBox | ||
| Stadia | ||
| Other |
The supported gamepad mapping profiles. Add a new one or use Other
enum Platform
Section titled “enum Platform”| Enumerator | Value | Description |
|---|---|---|
| Unknown | 0 | |
| Windows | ||
| Mac | ||
| Linux | ||
| Android | ||
| IOS | ||
| Count |
Supported OS platforms. When a gamepad from another platform is present, it should be added here. The value Unknown should always be first, and Count should always remain last.
Protected Types Documentation
Section titled “Protected Types Documentation”enum JSIndex
Section titled “enum JSIndex”| Enumerator | Value | Description |
|---|---|---|
| South | 0 | |
| LeftStickX | 0 | |
| East | 1 | |
| LeftStickY | 1 | |
| West | 2 | |
| RightStickX | 2 | |
| North | 3 | |
| RightStickY | 3 | |
| LeftBumper | 4 | |
| RightBumper | 5 | |
| LeftTrigger | 6 | |
| RightTrigger | 7 | |
| Select | 8 | |
| Start | 9 | |
| LeftStickPress | 10 | |
| RightStickPress | 11 | |
| DPadUp | 12 | |
| DPadDown | 13 | |
| DPadLeft | 14 | |
| DPadRight | 15 | |
| System | 16 | |
| Extra1 | 17 | |
| Extra2 | 18 |
Buttons and Axes displayed in the correct order in the array according to the W3C standard. Each number corresponds to the index in the array.
Public Functions Documentation
Section titled “Public Functions Documentation”function UpdateEntities
Section titled “function UpdateEntities”virtual void UpdateEntities()Updates the array of buttons and axes based on the mapping.
Reimplemented by: cohtml.InputSystem.GamepadMapWinPS.UpdateEntities
Protected Functions Documentation
Section titled “Protected Functions Documentation”function GamepadMapper
Section titled “function GamepadMapper”GamepadMapper( uint id, string name, int buttonsLength =16, int axesLength =4)function MapButton
Section titled “function MapButton”string MapButton( byte button)function MapAxis
Section titled “function MapAxis”string MapAxis( byte axis)function UpdateButtons
Section titled “function UpdateButtons”virtual void UpdateButtons()Updates the array of buttons based on the mapping.
function UpdateDPad
Section titled “function UpdateDPad”virtual void UpdateDPad( string mapX, bool isInvertedX, string mapY, bool isInvertedY)Most D-Pad buttons are mapped to 2 axes, but sometimes they are 4 buttons, sometimes are inverted axes, Provide a way to handle the buttons mapping.
Parameters:
- mapX Provide the horizontally mapping string
- isInvertedX “Does it indicate whether the horizontal axis is inverted?”
- mapY “Provide the vertically mapping string”
- isInvertedY Does it indicate whether the vertical axis is inverted?
function UpdateValue
Section titled “function UpdateValue”virtual void UpdateValue( float [] array, JSIndex jsIndex, float value)A helper method used by all the above methods to update the value of provided array index.
Public Property Documentation
Section titled “Public Property Documentation”property ProfileType
Section titled “property ProfileType”abstract Profile ProfileType;Public Attributes Documentation
Section titled “Public Attributes Documentation”variable CohtmlGamepadStr
Section titled “variable CohtmlGamepadStr”const string CohtmlGamepadStr = "Cohtml_Gamepad";variable CohtmlGamepadAxisName
Section titled “variable CohtmlGamepadAxisName”readonly string CohtmlGamepadAxisName;variable JoystickButtonName
Section titled “variable JoystickButtonName”readonly string JoystickButtonName;Protected Attributes Documentation
Section titled “Protected Attributes Documentation”variable m_ButtonsMap
Section titled “variable m_ButtonsMap”Dictionary< JSIndex, string > m_ButtonsMap;variable m_AxesMap
Section titled “variable m_AxesMap”Dictionary< JSIndex, string > m_AxesMap;variable m_FloatValue
Section titled “variable m_FloatValue”float m_FloatValue;variable m_JsIndex
Section titled “variable m_JsIndex”JSIndex m_JsIndex;© 2026 Coherent Labs. All rights reserved.