你这是说的HoloLens手势识别,在HoloLens里叫Hold手势,它有三个事件HoldStarted(捏住) 、HoldCompleted(松开)、HoldCanceled(取消)用来控制的。
如果你是C# DirectX应用的话可以参考刚刚开源的 VR for VLC 项目的 VRPlayer.Common.SpatialInputHandler 输入控制类。
public SpatialInputHandler()
{
interactionManager = SpatialInteractionManager.GetForCurrentView();
interactionManager.InteractionDetected += OnInteractionDetected;
gestureRecognizer = new SpatialGestureRecognizer(
SpatialGestureSettings.Tap |
SpatialGestureSettings.DoubleTap |
SpatialGestureSettings.Hold
);
gestureRecognizer.Tapped += OnTap;
gestureRecognizer.HoldStarted += OnHoldStarted;//注册捏住的事件
gestureRecognizer.HoldCompleted += OnHoldComleted;//注册松开的事件
}