Skip to content

Commit 6fd5ee0

Browse files
authored
Merge branch 'master' into muxtestinfra
2 parents c9b98c2 + 830e9af commit 6fd5ee0

File tree

88 files changed

+3460
-4046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3460
-4046
lines changed

GazeInputTest/GazeInputTest.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@
157157
</PackageReference>
158158
</ItemGroup>
159159
<ItemGroup>
160-
<ProjectReference Include="..\Microsoft.Toolkit.UWP.Input.GazeInteraction\Microsoft.Toolkit.Uwp.Input.GazeInteraction.vcxproj">
161-
<Project>{a5e98964-45b1-442d-a07a-298a3221d81e}</Project>
160+
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.Input.GazeInteraction\Microsoft.Toolkit.Uwp.Input.GazeInteraction.csproj">
161+
<Project>{5bf75694-798a-43a0-8150-415de195359c}</Project>
162162
<Name>Microsoft.Toolkit.Uwp.Input.GazeInteraction</Name>
163163
</ProjectReference>
164164
</ItemGroup>

GazeInputTest/Properties/AssemblyInfo.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Reflection;
66
using System.Runtime.InteropServices;
77

8-
// General Information about an assembly is controlled through the following
8+
// General Information about an assembly is controlled through the following
99
// set of attributes. Change these attribute values to modify the information
1010
// associated with an assembly.
1111
[assembly: AssemblyTitle("GazeInputTest")]
@@ -20,13 +20,13 @@
2020
// Version information for an assembly consists of the following four values:
2121
//
2222
// Major Version
23-
// Minor Version
23+
// Minor Version
2424
// Build Number
2525
// Revision
2626
//
27-
// You can specify all the values or you can default the Build and Revision Numbers
27+
// You can specify all the values or you can default the Build and Revision Numbers
2828
// by using the '*' as shown below:
2929
// [assembly: AssemblyVersion("1.0.*")]
30-
//[assembly: AssemblyVersion("1.0.0.0")]
31-
//[assembly: AssemblyFileVersion("1.0.0.0")]
30+
// [assembly: AssemblyVersion("1.0.0.0")]
31+
// [assembly: AssemblyFileVersion("1.0.0.0")]
3232
[assembly: ComVisible(false)]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using Windows.UI.Xaml;
6+
using Windows.UI.Xaml.Automation.Peers;
7+
using Windows.UI.Xaml.Controls;
8+
9+
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction
10+
{
11+
internal class ComboBoxItemGazeTargetItem : GazeTargetItem
12+
{
13+
internal ComboBoxItemGazeTargetItem(UIElement element)
14+
: base(element)
15+
{
16+
}
17+
18+
internal override void Invoke()
19+
{
20+
var peer = FrameworkElementAutomationPeer.FromElement(TargetElement);
21+
var comboBoxItemAutomationPeer = peer as ComboBoxItemAutomationPeer;
22+
var comboBoxItem = (ComboBoxItem)comboBoxItemAutomationPeer.Owner;
23+
24+
AutomationPeer ancestor = comboBoxItemAutomationPeer;
25+
var comboBoxAutomationPeer = ancestor as ComboBoxAutomationPeer;
26+
while (comboBoxAutomationPeer == null)
27+
{
28+
ancestor = ancestor.Navigate(AutomationNavigationDirection.Parent) as AutomationPeer;
29+
comboBoxAutomationPeer = ancestor as ComboBoxAutomationPeer;
30+
}
31+
32+
comboBoxItem.IsSelected = true;
33+
comboBoxAutomationPeer.Collapse();
34+
}
35+
}
36+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System.ComponentModel;
6+
7+
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction
8+
{
9+
/// <summary>
10+
/// This parameter is passed to the GazeElement::Invoked event and allows
11+
/// the application to prevent default invocation when the user dwells on a control
12+
/// </summary>
13+
public sealed class DwellInvokedRoutedEventArgs : HandledEventArgs
14+
{
15+
internal DwellInvokedRoutedEventArgs()
16+
{
17+
}
18+
}
19+
}

Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellInvokedRoutedEventArgs.h

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using System.ComponentModel;
7+
8+
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction
9+
{
10+
/// <summary>
11+
/// This parameter is passed to the GazeElement.DwellProgressFeedback event. The event is fired to inform the application of the user's progress towards completing dwelling on a control
12+
/// </summary>
13+
public sealed class DwellProgressEventArgs : HandledEventArgs
14+
{
15+
/// <summary>
16+
/// Gets an enum that reflects the current state of dwell progress
17+
/// </summary>
18+
public DwellProgressState State { get; }
19+
20+
/// <summary>
21+
/// Gets a value between 0 and 1 that reflects the fraction of progress towards completing dwell
22+
/// </summary>
23+
public double Progress { get; }
24+
25+
internal DwellProgressEventArgs(DwellProgressState state, TimeSpan elapsedDuration, TimeSpan triggerDuration)
26+
{
27+
State = state;
28+
Progress = ((double)elapsedDuration.Ticks) / triggerDuration.Ticks;
29+
}
30+
}
31+
}

Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressEventArgs.h

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction
6+
{
7+
/// <summary>
8+
/// An enum that reflects the current state of progress towards dwell when a user is focused on a control
9+
/// </summary>
10+
public enum DwellProgressState
11+
{
12+
/// <summary>
13+
/// User is not looking at the control
14+
/// </summary>
15+
Idle,
16+
17+
/// <summary>
18+
/// Gaze has entered control but we're not yet showing progress.
19+
/// </summary>
20+
Fixating,
21+
22+
/// <summary>
23+
/// User is continuing to focus on a control with an intent to dwell and invoke
24+
/// </summary>
25+
Progressing,
26+
27+
/// <summary>
28+
/// User has completed dwelling on a control
29+
/// </summary>
30+
Complete
31+
}
32+
}

Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressState.h

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using Windows.UI.Xaml;
6+
using Windows.UI.Xaml.Automation;
7+
using Windows.UI.Xaml.Automation.Peers;
8+
using Windows.UI.Xaml.Automation.Provider;
9+
10+
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction
11+
{
12+
internal class ExpandCollapsePatternGazeTargetItem : GazeTargetItem
13+
{
14+
internal ExpandCollapsePatternGazeTargetItem(UIElement element)
15+
: base(element)
16+
{
17+
}
18+
19+
internal override void Invoke()
20+
{
21+
var peer = FrameworkElementAutomationPeer.FromElement(TargetElement);
22+
var provider = peer.GetPattern(PatternInterface.ExpandCollapse) as IExpandCollapseProvider;
23+
switch (provider.ExpandCollapseState)
24+
{
25+
case ExpandCollapseState.Collapsed:
26+
provider.Expand();
27+
break;
28+
29+
case ExpandCollapseState.Expanded:
30+
provider.Collapse();
31+
break;
32+
}
33+
}
34+
}
35+
}

Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeCursor.cpp

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)