SimpleHapticsController Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides access to a single haptic input device that can be used to enumerate the haptic waveforms supported by the associated input device and trigger a specific haptic response.
public ref class SimpleHapticsController sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class SimpleHapticsController final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class SimpleHapticsController
Public NotInheritable Class SimpleHapticsController
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10 Creators Update (introduced in 10.0.15063.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v4.0)
|
Examples
The following fully functional samples demonstrate haptic features across various devices.
Pen haptics
See the Pen haptics sample for working examples of the following functionality:
- Get a SimpleHapticsController from pen input: Go from PointerPoint.PointerId to PenDevice to SimpleHapticsController (requires both a haptic-capable pen and a device that supports the pen).
- Check pen haptics capabilities: A SimpleHapticsController exposes properties for pen hardware capabilities, including IsIntensitySupported, IsPlayCountSupported, SupportedFeedback, and so on.
- Start and stop haptic feedback: Use the SendHapticFeedback and StopFeedback methods appropriately.
- Trigger haptic feedback: Feedback for both inking feedback and interaction feedback.
RadialController haptics
See the RadialController for examples of how to use haptics with RadialController devices such as the Surface Dial.
Mixed reality controller haptics
See the Spatial interaction source sample for an example of how to use haptics with Six Degree of Freedom (6DOF) Controllers on Windows Mixed Reality Desktop.
Properties
Id |
Gets the identifier for the haptic input device. |
IsIntensitySupported |
Gets whether the haptic input device supports feedback intensity. |
IsPlayCountSupported |
Gets whether the haptic input device supports feedback counts. |
IsPlayDurationSupported |
Gets whether the haptic input device supports feedback duration. |
IsReplayPauseIntervalSupported |
Gets whether the haptic input device supports pause intervals between feedback cycles. |
SupportedFeedback |
Gets the types of feedback supported by the haptic input device. |
Methods
SendHapticFeedback(SimpleHapticsControllerFeedback) |
Start haptic feedback by the input device. |
SendHapticFeedback(SimpleHapticsControllerFeedback, Double) |
Start haptic feedback by the input device with the specified intensity. |
SendHapticFeedbackForDuration(SimpleHapticsControllerFeedback, Double, TimeSpan) |
Start haptic feedback by the input device and continue for the specified amount of time. |
SendHapticFeedbackForPlayCount(SimpleHapticsControllerFeedback, Double, Int32, TimeSpan) |
Start haptic feedback by the input device and repeat for the specified number of times. |
StopFeedback() |
Terminates haptic feedback by the input device. |