1
1
// Copyright (c) Microsoft Corporation. All rights reserved.
2
2
// Licensed under the MIT License. See LICENSE in the project root for license information.
3
3
4
+ using Microsoft . MixedReality . Toolkit . Internal . Definitions . Utilities ;
4
5
using Microsoft . MixedReality . Toolkit . Internal . Utilities ;
5
6
using NUnit . Framework ;
6
7
@@ -11,16 +12,16 @@ public class UnityInputManagerHelperTests
11
12
[ Test ]
12
13
public void Test01_TestAddCustomMappings ( )
13
14
{
14
- InputMappingAxisUtility . InputManagerAxis [ ] OpenVRControllerAxisMappings =
15
+ InputManagerAxis [ ] OpenVRControllerAxisMappings =
15
16
{
16
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_LEFT_CONTROLLER_HORIZONTAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 1 } ,
17
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_LEFT_CONTROLLER_VERTICAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 2 } ,
18
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_RIGHT_CONTROLLER_HORIZONTAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 4 } ,
19
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_RIGHT_CONTROLLER_VERTICAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 5 } ,
20
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TRIGGER_LEFT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 9 } ,
21
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TRIGGER_RIGHT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 10 } ,
22
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_GRIP_LEFT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 11 } ,
23
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_GRIP_RIGHT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 12 }
17
+ new InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_LEFT_CONTROLLER_HORIZONTAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 1 } ,
18
+ new InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_LEFT_CONTROLLER_VERTICAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 2 } ,
19
+ new InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_RIGHT_CONTROLLER_HORIZONTAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 4 } ,
20
+ new InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_RIGHT_CONTROLLER_VERTICAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 5 } ,
21
+ new InputManagerAxis ( ) { Name = "OPENVR_TRIGGER_LEFT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 9 } ,
22
+ new InputManagerAxis ( ) { Name = "OPENVR_TRIGGER_RIGHT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 10 } ,
23
+ new InputManagerAxis ( ) { Name = "OPENVR_GRIP_LEFT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 11 } ,
24
+ new InputManagerAxis ( ) { Name = "OPENVR_GRIP_RIGHT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 12 }
24
25
} ;
25
26
26
27
InputMappingAxisUtility . ApplyMappings ( OpenVRControllerAxisMappings ) ;
@@ -38,16 +39,16 @@ public void Test01_TestAddCustomMappings()
38
39
[ Test ]
39
40
public void Test02_TestRemoveCustomMappings ( )
40
41
{
41
- InputMappingAxisUtility . InputManagerAxis [ ] OpenVRControllerAxisMappings =
42
+ InputManagerAxis [ ] OpenVRControllerAxisMappings =
42
43
{
43
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_LEFT_CONTROLLER_HORIZONTAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 1 } ,
44
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_LEFT_CONTROLLER_VERTICAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 2 } ,
45
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_RIGHT_CONTROLLER_HORIZONTAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 4 } ,
46
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_RIGHT_CONTROLLER_VERTICAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 5 } ,
47
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TRIGGER_LEFT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 9 } ,
48
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_TRIGGER_RIGHT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 10 } ,
49
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_GRIP_LEFT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 11 } ,
50
- new InputMappingAxisUtility . InputManagerAxis ( ) { Name = "OPENVR_GRIP_RIGHT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputMappingAxisUtility . MappingAxisType . JoystickAxis , Axis = 12 }
44
+ new InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_LEFT_CONTROLLER_HORIZONTAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 1 } ,
45
+ new InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_LEFT_CONTROLLER_VERTICAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 2 } ,
46
+ new InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_RIGHT_CONTROLLER_HORIZONTAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 4 } ,
47
+ new InputManagerAxis ( ) { Name = "OPENVR_TOUCHPAD_RIGHT_CONTROLLER_VERTICAL" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 5 } ,
48
+ new InputManagerAxis ( ) { Name = "OPENVR_TRIGGER_LEFT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 9 } ,
49
+ new InputManagerAxis ( ) { Name = "OPENVR_TRIGGER_RIGHT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 10 } ,
50
+ new InputManagerAxis ( ) { Name = "OPENVR_GRIP_LEFT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 11 } ,
51
+ new InputManagerAxis ( ) { Name = "OPENVR_GRIP_RIGHT_CONTROLLER" , Dead = 0.001f , Sensitivity = 1 , Invert = false , Type = InputManagerAxisType . JoystickAxis , Axis = 12 }
51
52
} ;
52
53
53
54
InputMappingAxisUtility . RemoveMappings ( OpenVRControllerAxisMappings ) ;
0 commit comments