-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into muxtestinfra
- Loading branch information
Showing
88 changed files
with
3,460 additions
and
4,046 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
Microsoft.Toolkit.Uwp.Input.GazeInteraction/ComboBoxItemGazeTargetItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Automation.Peers; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction | ||
{ | ||
internal class ComboBoxItemGazeTargetItem : GazeTargetItem | ||
{ | ||
internal ComboBoxItemGazeTargetItem(UIElement element) | ||
: base(element) | ||
{ | ||
} | ||
|
||
internal override void Invoke() | ||
{ | ||
var peer = FrameworkElementAutomationPeer.FromElement(TargetElement); | ||
var comboBoxItemAutomationPeer = peer as ComboBoxItemAutomationPeer; | ||
var comboBoxItem = (ComboBoxItem)comboBoxItemAutomationPeer.Owner; | ||
|
||
AutomationPeer ancestor = comboBoxItemAutomationPeer; | ||
var comboBoxAutomationPeer = ancestor as ComboBoxAutomationPeer; | ||
while (comboBoxAutomationPeer == null) | ||
{ | ||
ancestor = ancestor.Navigate(AutomationNavigationDirection.Parent) as AutomationPeer; | ||
comboBoxAutomationPeer = ancestor as ComboBoxAutomationPeer; | ||
} | ||
|
||
comboBoxItem.IsSelected = true; | ||
comboBoxAutomationPeer.Collapse(); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellInvokedRoutedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.ComponentModel; | ||
|
||
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction | ||
{ | ||
/// <summary> | ||
/// This parameter is passed to the GazeElement::Invoked event and allows | ||
/// the application to prevent default invocation when the user dwells on a control | ||
/// </summary> | ||
public sealed class DwellInvokedRoutedEventArgs : HandledEventArgs | ||
{ | ||
internal DwellInvokedRoutedEventArgs() | ||
{ | ||
} | ||
} | ||
} |
28 changes: 0 additions & 28 deletions
28
Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellInvokedRoutedEventArgs.h
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.ComponentModel; | ||
|
||
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction | ||
{ | ||
/// <summary> | ||
/// 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 | ||
/// </summary> | ||
public sealed class DwellProgressEventArgs : HandledEventArgs | ||
{ | ||
/// <summary> | ||
/// Gets an enum that reflects the current state of dwell progress | ||
/// </summary> | ||
public DwellProgressState State { get; } | ||
|
||
/// <summary> | ||
/// Gets a value between 0 and 1 that reflects the fraction of progress towards completing dwell | ||
/// </summary> | ||
public double Progress { get; } | ||
|
||
internal DwellProgressEventArgs(DwellProgressState state, TimeSpan elapsedDuration, TimeSpan triggerDuration) | ||
{ | ||
State = state; | ||
Progress = ((double)elapsedDuration.Ticks) / triggerDuration.Ticks; | ||
} | ||
} | ||
} |
43 changes: 0 additions & 43 deletions
43
Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressEventArgs.h
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction | ||
{ | ||
/// <summary> | ||
/// An enum that reflects the current state of progress towards dwell when a user is focused on a control | ||
/// </summary> | ||
public enum DwellProgressState | ||
{ | ||
/// <summary> | ||
/// User is not looking at the control | ||
/// </summary> | ||
Idle, | ||
|
||
/// <summary> | ||
/// Gaze has entered control but we're not yet showing progress. | ||
/// </summary> | ||
Fixating, | ||
|
||
/// <summary> | ||
/// User is continuing to focus on a control with an intent to dwell and invoke | ||
/// </summary> | ||
Progressing, | ||
|
||
/// <summary> | ||
/// User has completed dwelling on a control | ||
/// </summary> | ||
Complete | ||
} | ||
} |
34 changes: 0 additions & 34 deletions
34
Microsoft.Toolkit.Uwp.Input.GazeInteraction/DwellProgressState.h
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
Microsoft.Toolkit.Uwp.Input.GazeInteraction/ExpandCollapsePatternGazeTargetItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Automation; | ||
using Windows.UI.Xaml.Automation.Peers; | ||
using Windows.UI.Xaml.Automation.Provider; | ||
|
||
namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction | ||
{ | ||
internal class ExpandCollapsePatternGazeTargetItem : GazeTargetItem | ||
{ | ||
internal ExpandCollapsePatternGazeTargetItem(UIElement element) | ||
: base(element) | ||
{ | ||
} | ||
|
||
internal override void Invoke() | ||
{ | ||
var peer = FrameworkElementAutomationPeer.FromElement(TargetElement); | ||
var provider = peer.GetPattern(PatternInterface.ExpandCollapse) as IExpandCollapseProvider; | ||
switch (provider.ExpandCollapseState) | ||
{ | ||
case ExpandCollapseState.Collapsed: | ||
provider.Expand(); | ||
break; | ||
|
||
case ExpandCollapseState.Expanded: | ||
provider.Collapse(); | ||
break; | ||
} | ||
} | ||
} | ||
} |
80 changes: 0 additions & 80 deletions
80
Microsoft.Toolkit.Uwp.Input.GazeInteraction/GazeCursor.cpp
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.