Skip to content

Commit 4dcc316

Browse files
Docs and Standards pass
1 parent 7d11f18 commit 4dcc316

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Assets/MixedRealityToolkit/_Core/Definitions/Devices/ControllerInputAxisMappingLibrary.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
namespace Microsoft.MixedReality.Toolkit.Internal.Definitions.Devices
88
{
9+
/// <summary>
10+
/// Helper utility to manage all the required Axis configuration for platforms, where required
11+
/// </summary>
912
public static class ControllerInputAxisMappingLibrary
1013
{
1114
#region Controller axis mapping configuration
1215

16+
//Axis and Input mapping configuration for each controller type. Centralized here... Because Unity..
17+
1318
#region OpenVR
1419

1520
private static readonly string[] OpenVRInputMappings =
@@ -162,6 +167,9 @@ public static class ControllerInputAxisMappingLibrary
162167

163168
#region Controller axis library
164169

170+
/// <summary>
171+
/// Collection of the above Controller mapping configuration, used to load the Unity Input Manager axis mappings.
172+
/// </summary>
165173
private static Dictionary<string, InputManagerAxis[]> InputManagerAxis = new Dictionary<string, InputManagerAxis[]>()
166174
{
167175
{ typeof(Internal.Devices.OpenVR.GenericOpenVRController).FullName, OpenVRControllerAxisMappings },
@@ -170,6 +178,9 @@ public static class ControllerInputAxisMappingLibrary
170178
{ typeof(Internal.Devices.OpenVR.ValveKnucklesController).FullName, ValveKnucklesControllerAxisMappings },
171179
};
172180

181+
/// <summary>
182+
/// Collection of the above Controller axis mapping strings, used by controllers to query the correct axis name
183+
/// </summary>
173184
private static Dictionary<string, string[]> InputManagerMappings = new Dictionary<string, string[]>()
174185
{
175186
{ typeof(Internal.Devices.OpenVR.GenericOpenVRController).FullName, OpenVRInputMappings },
@@ -180,11 +191,21 @@ public static class ControllerInputAxisMappingLibrary
180191

181192
#endregion Controller axis library
182193

194+
/// <summary>
195+
/// Get the InputManagerAxis data needed to configure the Input Mappings for a controller
196+
/// </summary>
197+
/// <param name="type">The type of controller to retrieve configuration for</param>
198+
/// <returns></returns>
183199
public static InputManagerAxis[] GetInputManagerAxes(string type)
184200
{
185201
return InputManagerAxis.ContainsKey(type) ? InputManagerAxis[type] : default(InputManagerAxis[]);
186202
}
187203

204+
/// <summary>
205+
/// Get the Input Manager string Mappings for a specific controller type
206+
/// </summary>
207+
/// <param name="type">The type of controller to retrieve configuration for</param>
208+
/// <returns></returns>
188209
public static string[] GetInputManagerMappings(string type)
189210
{
190211
return InputManagerMappings.ContainsKey(type) ? InputManagerMappings[type] : default(string[]);

Assets/MixedRealityToolkit/_Core/Definitions/Utilities/InputManagerAxisType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ public enum InputManagerAxisType
1111
KeyOrMouseButton = 0,
1212
MouseMovement,
1313
JoystickAxis
14-
};
14+
}
1515
}

0 commit comments

Comments
 (0)