Пример #1
0
 /// <summary>
 /// Play a canned haptic pattern.
 /// </summary>
 /// <param name="expr"></param>
 public override void Play(HapticExpression expr)
 {
     if (expr != HapticExpression.None)
     {
         NativeMethods.PlayTaptic((uint)expr);
     }
 }
Пример #2
0
 /// <summary>
 /// Play a canned haptic pattern.
 /// </summary>
 /// <param name="expr"></param>
 public override void Play(HapticExpression expr)
 {
     if (expr == HapticExpression.Click)
     {
         controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Click, MLInputControllerFeedbackIntensity.Medium);
     }
     else if (expr == HapticExpression.Light)
     {
         controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Buzz, MLInputControllerFeedbackIntensity.Low);
     }
     else if (expr == HapticExpression.Medium)
     {
         controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Buzz, MLInputControllerFeedbackIntensity.Medium);
     }
     else if (expr == HapticExpression.Heavy)
     {
         controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Buzz, MLInputControllerFeedbackIntensity.High);
     }
     else if (expr == HapticExpression.Press)
     {
         controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.ForceDown, MLInputControllerFeedbackIntensity.Medium);
     }
     else if (expr == HapticExpression.Release)
     {
         controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.ForceUp, MLInputControllerFeedbackIntensity.Medium);
     }
     else if (expr == HapticExpression.SelectionChange)
     {
         controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Tick, MLInputControllerFeedbackIntensity.Low);
     }
     else
     {
         base.Play(expr);
     }
 }
Пример #3
0
 /// <summary>
 /// Retrieves an array of HapticPatternElements for a given HapticExpression instructs the
 /// device to play that pattern.
 /// </summary>
 /// <param name="device">    Device.</param>
 /// <param name="expression">Expression.</param>
 public static void Play(IHapticDevice device, HapticExpression expression)
 {
     if (device != null &&
         expressions.ContainsKey(expression))
     {
         device.Play(expressions[expression]);
     }
 }
Пример #4
0
 /// <summary>
 /// Play a canned haptic pattern.
 /// </summary>
 /// <param name="expr"></param>
 public override void Play(HapticExpression expr)
 {
     if (controller != null)
     {
         if (expr == HapticExpression.Click)
         {
             controller.SendHapticFeedback(click);
         }
         else if (expr == HapticExpression.Press)
         {
             controller.SendHapticFeedback(press);
         }
         else if (expr == HapticExpression.Release)
         {
             controller.SendHapticFeedback(release);
         }
         else
         {
             base.Play(expr);
         }
     }
 }
Пример #5
0
 /// <summary>
 /// Play a canned haptic pattern.
 /// </summary>
 /// <param name="expr"></param>
 public abstract void Play(HapticExpression expr);
Пример #6
0
 /// <summary>
 /// Play a canned haptic pattern.
 /// </summary>
 /// <param name="expr"></param>
 public override void Play(HapticExpression expr)
 {
     HapticPatternElement.Play(this, expr);
 }
Пример #7
0
 /// <summary>
 /// Performs no operation.
 /// </summary>
 public override void Play(HapticExpression expr)
 {
 }