Skip to content

Commit a618023

Browse files
authored
Merge pull request #433 from aalmada/InputManagerRefactoring
Changed InputManager.HandleEvent() to public and removed all events from IInputSource.
2 parents c56554b + b03a1a4 commit a618023

File tree

27 files changed

+234
-745
lines changed

27 files changed

+234
-745
lines changed

Assets/HoloToolkit-Examples/ColorPicker/GazeableColorPicker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void OnFocusExit()
4949
gazing = false;
5050
}
5151

52-
public void OnInputClicked(InputEventData eventData)
52+
public void OnInputClicked(InputClickedEventData eventData)
5353
{
5454
UpdatePickedColor(OnPickedColor);
5555
}

Assets/HoloToolkit-Examples/GazeRuler/Scripts/MeasureManager.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
using UnityEngine;
@@ -104,11 +104,11 @@ public void OnHoldCanceled(HoldEventData eventData)
104104
// Nothing to do
105105
}
106106

107-
public void OnInputClicked(InputEventData eventData)
108-
{
109-
OnSelect();
110-
}
107+
public void OnInputClicked(InputClickedEventData eventData)
108+
{
109+
OnSelect();
111110
}
111+
}
112112

113113
public class Point
114114
{
@@ -127,4 +127,4 @@ public enum GeometryMode
127127
Cube,
128128
Polygon
129129
}
130-
}
130+
}

Assets/HoloToolkit-Examples/SharingWithUNET/Scripts/PlayerController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void CmdFire()
139139
Destroy(nextBullet, 8.0f);
140140
}
141141

142-
public void OnInputClicked(InputEventData eventData)
142+
public void OnInputClicked(InputClickedEventData eventData)
143143
{
144144
if (isLocalPlayer)
145145
{

Assets/HoloToolkit-Examples/SpatialUnderstanding/SpatialUnderstanding-FeatureOverview/Scripts/AppState.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,12 @@ public void OnSourceLost(SourceStateEventData eventData)
260260
}
261261
}
262262

263-
public void OnInputClicked(InputEventData eventData)
263+
public void OnInputClicked(InputClickedEventData eventData)
264+
{
265+
if ((SpatialUnderstanding.Instance.ScanState == SpatialUnderstanding.ScanStates.Scanning) &&
266+
!SpatialUnderstanding.Instance.ScanStatsReportStillWorking)
264267
{
265-
if ((SpatialUnderstanding.Instance.ScanState == SpatialUnderstanding.ScanStates.Scanning) &&
266-
!SpatialUnderstanding.Instance.ScanStatsReportStillWorking)
267-
{
268-
SpatialUnderstanding.Instance.RequestFinishScan();
269-
}
268+
SpatialUnderstanding.Instance.RequestFinishScan();
270269
}
271270
}
272-
}
271+
}

Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public virtual void OnInputDown(InputEventData eventData)
368368
/// Function for receiving OnInputClicked events from InputManager
369369
/// </summary>
370370
/// <param name="eventData"></param>
371-
public virtual void OnInputClicked(InputEventData eventData)
371+
public virtual void OnInputClicked(InputClickedEventData eventData)
372372
{
373373
// Open input socket for other cool stuff...
374374
}

Assets/HoloToolkit/Input/Scripts/InputEvents/IInputClickHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ namespace HoloToolkit.Unity.InputModule
1010
/// </summary>
1111
public interface IInputClickHandler : IEventSystemHandler
1212
{
13-
void OnInputClicked(InputEventData eventData);
13+
void OnInputClicked(InputClickedEventData eventData);
1414
}
1515
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
using UnityEngine;
5+
using UnityEngine.EventSystems;
6+
7+
namespace HoloToolkit.Unity.InputModule
8+
{
9+
/// <summary>
10+
/// Describes an input event that involves a tap.
11+
/// </summary>
12+
public class InputClickedEventData : InputEventData
13+
{
14+
/// <summary>
15+
/// Number of taps that triggered the event.
16+
/// </summary>
17+
public int TapCount { get; private set; }
18+
19+
public InputClickedEventData(EventSystem eventSystem) : base(eventSystem)
20+
{
21+
}
22+
23+
public void Initialize(IInputSource inputSource, uint sourceId, int tapCount)
24+
{
25+
BaseInitialize(inputSource, sourceId);
26+
TapCount = tapCount;
27+
}
28+
}
29+
}

Assets/HoloToolkit/Input/Scripts/InputSources/SpeechKeywordRecognizedEventArgs.cs.meta renamed to Assets/HoloToolkit/Input/Scripts/InputEvents/InputClickedEventData.cs.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)