Skip to content

Commit d0e04ec

Browse files
authored
Fixed articulated hands being classified as HP Motion Controllers (#9410)
* Fixed articulated hands being classified as HP Motion Controllers * small modification to ensure we only name interaction sources of kind controller * small adjustment to the naming schemes
1 parent 7d84217 commit d0e04ec

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Assets/MRTK/Providers/WindowsMixedReality/XR2018/WindowsMixedRealityDeviceManager.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,13 @@ private BaseWindowsMixedRealitySource GetOrAddController(InteractionSource inter
720720

721721
}
722722

723-
string nameModifier = controllingHand == Handedness.None ? interactionSource.kind.ToString() : controllingHand.ToString();
724-
bool isHPController = !interactionSource.supportsTouchpad;
725-
string inputSourceName = isHPController ? $"HP Motion Controller {nameModifier}" : $"Mixed Reality Controller {nameModifier}";
723+
bool isHPController = !interactionSource.supportsTouchpad && interactionSource.kind == InteractionSourceKind.Controller;
724+
725+
string kindModifier = interactionSource.kind.ToString();
726+
string handednessModifier = controllingHand == Handedness.None ? string.Empty : controllingHand.ToString();
727+
728+
string inputSourceName = isHPController ? $"HP Motion {kindModifier} {handednessModifier}" : $"Mixed Reality {kindModifier} {handednessModifier}";
729+
726730
var inputSource = Service?.RequestNewGenericInputSource(inputSourceName, pointers, inputSourceType);
727731

728732
BaseWindowsMixedRealitySource detectedController;

0 commit comments

Comments
 (0)