Skip to content

Commit f9f3369

Browse files
authored
Merge pull request #3819 from luis-valverde-ms/input_system_interface
Removed variants of methods to raise input events that receive no handedness.
2 parents 9e3fe59 + 0917ea6 commit f9f3369

File tree

6 files changed

+10
-173
lines changed

6 files changed

+10
-173
lines changed

Assets/MixedRealityToolkit.Services/InputSystem/MixedRealityInputSystem.cs

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -942,18 +942,6 @@ public void RaisePointerUp(IMixedRealityPointer pointer, MixedRealityInputAction
942942
handler.OnInputDown(casted);
943943
};
944944

945-
/// <inheritdoc />
946-
public void RaiseOnInputDown(IMixedRealityInputSource source, MixedRealityInputAction inputAction)
947-
{
948-
inputAction = ProcessRules(inputAction, true);
949-
950-
// Create input event
951-
inputEventData.Initialize(source, inputAction);
952-
953-
// Pass handler through HandleEvent to perform modal/fallback logic
954-
HandleEvent(inputEventData, OnInputDownEventHandler);
955-
}
956-
957945
/// <inheritdoc />
958946
public void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction)
959947
{
@@ -977,18 +965,6 @@ public void RaiseOnInputDown(IMixedRealityInputSource source, Handedness handedn
977965
handler.OnInputUp(casted);
978966
};
979967

980-
/// <inheritdoc />
981-
public void RaiseOnInputUp(IMixedRealityInputSource source, MixedRealityInputAction inputAction)
982-
{
983-
inputAction = ProcessRules(inputAction, false);
984-
985-
// Create input event
986-
inputEventData.Initialize(source, inputAction);
987-
988-
// Pass handler through HandleEvent to perform modal/fallback logic
989-
HandleEvent(inputEventData, OnInputUpEventHandler);
990-
}
991-
992968
/// <inheritdoc />
993969
public void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction)
994970
{
@@ -1012,18 +988,6 @@ public void RaiseOnInputUp(IMixedRealityInputSource source, Handedness handednes
1012988
handler.OnInputChanged(casted);
1013989
};
1014990

1015-
/// <inheritdoc />
1016-
public void RaiseFloatInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, float inputValue)
1017-
{
1018-
inputAction = ProcessRules(inputAction, inputValue);
1019-
1020-
// Create input event
1021-
floatInputEventData.Initialize(source, inputAction, inputValue);
1022-
1023-
// Pass handler through HandleEvent to perform modal/fallback logic
1024-
HandleEvent(floatInputEventData, OnFloatInputChanged);
1025-
}
1026-
1027991
/// <inheritdoc />
1028992
public void RaiseFloatInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, float inputValue)
1029993
{
@@ -1047,18 +1011,6 @@ public void RaiseFloatInputChanged(IMixedRealityInputSource source, Handedness h
10471011
handler.OnInputChanged(casted);
10481012
};
10491013

1050-
/// <inheritdoc />
1051-
public void RaisePositionInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, Vector2 inputPosition)
1052-
{
1053-
inputAction = ProcessRules(inputAction, inputPosition);
1054-
1055-
// Create input event
1056-
vector2InputEventData.Initialize(source, inputAction, inputPosition);
1057-
1058-
// Pass handler through HandleEvent to perform modal/fallback logic
1059-
HandleEvent(vector2InputEventData, OnTwoDoFInputChanged);
1060-
}
1061-
10621014
/// <inheritdoc />
10631015
public void RaisePositionInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, Vector2 inputPosition)
10641016
{
@@ -1078,18 +1030,6 @@ public void RaisePositionInputChanged(IMixedRealityInputSource source, Handednes
10781030
handler.OnInputChanged(casted);
10791031
};
10801032

1081-
/// <inheritdoc />
1082-
public void RaisePositionInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, Vector3 position)
1083-
{
1084-
inputAction = ProcessRules(inputAction, position);
1085-
1086-
// Create input event
1087-
positionInputEventData.Initialize(source, inputAction, position);
1088-
1089-
// Pass handler through HandleEvent to perform modal/fallback logic
1090-
HandleEvent(positionInputEventData, OnPositionInputChanged);
1091-
}
1092-
10931033
/// <inheritdoc />
10941034
public void RaisePositionInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, Vector3 position)
10951035
{
@@ -1113,18 +1053,6 @@ public void RaisePositionInputChanged(IMixedRealityInputSource source, Handednes
11131053
handler.OnInputChanged(casted);
11141054
};
11151055

1116-
/// <inheritdoc />
1117-
public void RaiseRotationInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, Quaternion rotation)
1118-
{
1119-
inputAction = ProcessRules(inputAction, rotation);
1120-
1121-
// Create input event
1122-
rotationInputEventData.Initialize(source, inputAction, rotation);
1123-
1124-
// Pass handler through HandleEvent to perform modal/fallback logic
1125-
HandleEvent(positionInputEventData, OnRotationInputChanged);
1126-
}
1127-
11281056
/// <inheritdoc />
11291057
public void RaiseRotationInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, Quaternion rotation)
11301058
{
@@ -1148,18 +1076,6 @@ public void RaiseRotationInputChanged(IMixedRealityInputSource source, Handednes
11481076
handler.OnInputChanged(casted);
11491077
};
11501078

1151-
/// <inheritdoc />
1152-
public void RaisePoseInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, MixedRealityPose inputData)
1153-
{
1154-
inputAction = ProcessRules(inputAction, inputData);
1155-
1156-
// Create input event
1157-
poseInputEventData.Initialize(source, inputAction, inputData);
1158-
1159-
// Pass handler through HandleEvent to perform modal/fallback logic
1160-
HandleEvent(poseInputEventData, OnPoseInputChanged);
1161-
}
1162-
11631079
/// <inheritdoc />
11641080
public void RaisePoseInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, MixedRealityPose inputData)
11651081
{

Assets/MixedRealityToolkit/EventDatum/Input/HandTrackingInputEventData.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ public HandTrackingInputEventData(EventSystem eventSystem) : base(eventSystem) {
2222
/// <summary>
2323
/// This function is called to fill the HandTrackingIntputEventData object with information
2424
/// </summary>
25-
/// <param name="inputSource">This is a reference to the HandTrackingInputSource that created the EventData</param>
26-
/// <param name="controller">This is a reference to the IMixedRealityController that created the EventData</param>
27-
/// <param name="grabbing">This is a the state (grabbing or not grabbing) of the HandTrackingInputSource that created the EventData</param>
28-
/// <param name="pressing">This is a the state (pressing or not pressing) of the HandTrackingInputSource that created the EventData</param>
29-
/// <param name="actionPoint">This is a the global position grabbed by the HandTrackingInputSource that created the EventData</param>
30-
/// <param name="touchedObject">This is a the global position of the HandTrackingInputSource that created the EventData</param>
25+
/// <param name="inputSource">Reference to the HandTrackingInputSource that created the EventData</param>
26+
/// <param name="controller">Reference to the IMixedRealityController that created the EventData</param>
27+
/// <param name="sourceHandedness">Handedness of the HandTrackingInputSource that created the EventData</param>
28+
/// <param name="touchPoint">Global position of the HandTrackingInputSource that created the EventData</param>
3129
public void Initialize(IMixedRealityInputSource inputSource, IMixedRealityController controller, Handedness sourceHandedness, Vector3 touchPoint)
3230
{
33-
Initialize(inputSource, MixedRealityInputAction.None, touchPoint);
31+
Initialize(inputSource, sourceHandedness, MixedRealityInputAction.None, touchPoint);
3432
Controller = controller;
3533
}
3634
}

Assets/MixedRealityToolkit/EventDatum/Input/InputEventData.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,6 @@ public class InputEventData : BaseInputEventData
1919
/// <inheritdoc />
2020
public InputEventData(EventSystem eventSystem) : base(eventSystem) { }
2121

22-
/// <summary>
23-
/// Used to initialize/reset the event and populate the data.
24-
/// </summary>
25-
/// <param name="inputSource"></param>
26-
/// <param name="inputAction"></param>
27-
public void Initialize(IMixedRealityInputSource inputSource, MixedRealityInputAction inputAction)
28-
{
29-
BaseInitialize(inputSource, inputAction);
30-
Handedness = Handedness.None;
31-
}
32-
3322
/// <summary>
3423
/// Used to initialize/reset the event and populate the data.
3524
/// </summary>
@@ -57,18 +46,6 @@ public class InputEventData<T> : InputEventData
5746
/// <inheritdoc />
5847
public InputEventData(EventSystem eventSystem) : base(eventSystem) { }
5948

60-
/// <summary>
61-
/// Used to initialize/reset the event and populate the data.
62-
/// </summary>
63-
/// <param name="inputSource"></param>
64-
/// <param name="inputAction"></param>
65-
/// <param name="data"></param>
66-
public void Initialize(IMixedRealityInputSource inputSource, MixedRealityInputAction inputAction, T data)
67-
{
68-
Initialize(inputSource, inputAction);
69-
InputData = data;
70-
}
71-
7249
/// <summary>
7350
/// Used to initialize/reset the event and populate the data.
7451
/// </summary>

Assets/MixedRealityToolkit/Interfaces/InputSystem/IMixedRealityInputSystem.cs

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,6 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem
261261

262262
#region Input Down
263263

264-
/// <summary>
265-
/// Raise the input down event.
266-
/// </summary>
267-
/// <param name="source"></param>
268-
/// <param name="inputAction"></param>
269-
void RaiseOnInputDown(IMixedRealityInputSource source, MixedRealityInputAction inputAction);
270-
271264
/// <summary>
272265
/// Raise the input down event.
273266
/// </summary>
@@ -280,13 +273,6 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem
280273

281274
#region Input Up
282275

283-
/// <summary>
284-
/// Raise the input up event.
285-
/// </summary>
286-
/// <param name="source"></param>
287-
/// <param name="inputAction"></param>
288-
void RaiseOnInputUp(IMixedRealityInputSource source, MixedRealityInputAction inputAction);
289-
290276
/// <summary>
291277
/// Raise the input up event.
292278
/// </summary>
@@ -299,14 +285,6 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem
299285

300286
#region Float Input Changed
301287

302-
/// <summary>
303-
/// Raise Float Input Changed.
304-
/// </summary>
305-
/// <param name="source"></param>
306-
/// <param name="inputAction"></param>
307-
/// <param name="inputValue"></param>
308-
void RaiseFloatInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, float inputValue);
309-
310288
/// <summary>
311289
/// Raise Float Input Changed.
312290
/// </summary>
@@ -320,14 +298,6 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem
320298

321299
#region Input Position Changed
322300

323-
/// <summary>
324-
/// Raise the 2 degrees of freedom input event.
325-
/// </summary>
326-
/// <param name="source"></param>
327-
/// <param name="inputAction"></param>
328-
/// <param name="position"></param>
329-
void RaisePositionInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, Vector2 position);
330-
331301
/// <summary>
332302
/// Raise the 2 degrees of freedom input event.
333303
/// </summary>
@@ -337,14 +307,6 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem
337307
/// <param name="position"></param>
338308
void RaisePositionInputChanged(IMixedRealityInputSource source, Handedness handedness, MixedRealityInputAction inputAction, Vector2 position);
339309

340-
/// <summary>
341-
/// Raise the 3 degrees of freedom input event.
342-
/// </summary>
343-
/// <param name="source"></param>
344-
/// <param name="inputAction"></param>
345-
/// <param name="position"></param>
346-
void RaisePositionInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, Vector3 position);
347-
348310
/// <summary>
349311
/// Raise the 3 degrees of freedom input event.
350312
/// </summary>
@@ -358,14 +320,6 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem
358320

359321
#region Input Rotation Changed
360322

361-
/// <summary>
362-
/// Raise the 3 degrees of freedom input event.
363-
/// </summary>
364-
/// <param name="source"></param>
365-
/// <param name="inputAction"></param>
366-
/// <param name="rotation"></param>
367-
void RaiseRotationInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, Quaternion rotation);
368-
369323
/// <summary>
370324
/// Raise the 3 degrees of freedom input event.
371325
/// </summary>
@@ -379,14 +333,6 @@ public interface IMixedRealityInputSystem : IMixedRealityEventSystem
379333

380334
#region Input Pose Changed
381335

382-
/// <summary>
383-
/// Raise the 6 degrees of freedom input event.
384-
/// </summary>
385-
/// <param name="source"></param>
386-
/// <param name="inputAction"></param>
387-
/// <param name="inputData"></param>
388-
void RaisePoseInputChanged(IMixedRealityInputSource source, MixedRealityInputAction inputAction, MixedRealityPose inputData);
389-
390336
/// <summary>
391337
/// Raise the 6 degrees of freedom input event.
392338
/// </summary>

Assets/MixedRealityToolkit/Providers/UnityInput/MouseController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void Update()
8585

8686
if (Interactions[i].Changed)
8787
{
88-
MixedRealityToolkit.InputSystem?.RaisePoseInputChanged(InputSource, Interactions[i].MixedRealityInputAction, Interactions[i].PoseData);
88+
MixedRealityToolkit.InputSystem?.RaisePoseInputChanged(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction, Interactions[i].PoseData);
8989
}
9090
}
9191

@@ -95,7 +95,7 @@ public void Update()
9595

9696
if (Interactions[i].Changed)
9797
{
98-
MixedRealityToolkit.InputSystem?.RaisePositionInputChanged(InputSource, Interactions[i].MixedRealityInputAction, Interactions[i].Vector2Data);
98+
MixedRealityToolkit.InputSystem?.RaisePositionInputChanged(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction, Interactions[i].Vector2Data);
9999
}
100100
}
101101

@@ -105,7 +105,7 @@ public void Update()
105105

106106
if (Interactions[i].Changed)
107107
{
108-
MixedRealityToolkit.InputSystem?.RaisePositionInputChanged(InputSource, Interactions[i].MixedRealityInputAction, Interactions[i].Vector2Data);
108+
MixedRealityToolkit.InputSystem?.RaisePositionInputChanged(InputSource, ControllerHandedness, Interactions[i].MixedRealityInputAction, Interactions[i].Vector2Data);
109109
}
110110
}
111111

Assets/MixedRealityToolkit/Providers/UnityInput/UnityTouchController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void Update()
108108

109109
if (Interactions[0].Changed)
110110
{
111-
MixedRealityToolkit.InputSystem?.RaisePositionInputChanged(InputSource, Interactions[0].MixedRealityInputAction, TouchData.deltaPosition);
111+
MixedRealityToolkit.InputSystem?.RaisePositionInputChanged(InputSource, ControllerHandedness, Interactions[0].MixedRealityInputAction, TouchData.deltaPosition);
112112
}
113113

114114
lastPose.Position = InputSource.Pointers[0].BaseCursor.Position;
@@ -119,7 +119,7 @@ public void Update()
119119

120120
if (Interactions[1].Changed)
121121
{
122-
MixedRealityToolkit.InputSystem?.RaisePoseInputChanged(InputSource, Interactions[1].MixedRealityInputAction, lastPose);
122+
MixedRealityToolkit.InputSystem?.RaisePoseInputChanged(InputSource, ControllerHandedness, Interactions[1].MixedRealityInputAction, lastPose);
123123
}
124124

125125
if (!isManipulating)

0 commit comments

Comments
 (0)