InputHapticsManager.TrySendHapticWaveformForPlayCount Method
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.
Attempts to trigger the specified waveform, with the specified intensity, play count, and replay pause interval, on the input device that most recently delivered input to the thread. The fallback waveform is used if the first waveform is not supported.
public:
virtual bool TrySendHapticWaveformForPlayCount(unsigned short waveform, unsigned short waveformFallback, double intensity, int playCount, TimeSpan replayPauseInterval) = TrySendHapticWaveformForPlayCount;
bool TrySendHapticWaveformForPlayCount(uint16_t const& waveform, uint16_t const& waveformFallback, double const& intensity, int const& playCount, TimeSpan const& replayPauseInterval);
/// [Windows.Foundation.Metadata.Experimental]
bool TrySendHapticWaveformForPlayCount(uint16_t const& waveform, uint16_t const& waveformFallback, double const& intensity, int const& playCount, TimeSpan const& replayPauseInterval);
public bool TrySendHapticWaveformForPlayCount(ushort waveform, ushort waveformFallback, double intensity, int playCount, System.TimeSpan replayPauseInterval);
[Windows.Foundation.Metadata.Experimental]
public bool TrySendHapticWaveformForPlayCount(ushort waveform, ushort waveformFallback, double intensity, int playCount, System.TimeSpan replayPauseInterval);
function trySendHapticWaveformForPlayCount(waveform, waveformFallback, intensity, playCount, replayPauseInterval)
Public Function TrySendHapticWaveformForPlayCount (waveform As UShort, waveformFallback As UShort, intensity As Double, playCount As Integer, replayPauseInterval As TimeSpan) As Boolean
Parameters
- waveform
-
UInt16
unsigned short
uint16_t
The waveform to trigger. If 0, a default waveform is chosen for known device types (see Remarks). If waveform is 0, waveformFallback must also be 0.
- waveformFallback
-
UInt16
unsigned short
uint16_t
The fallback waveform to use if waveform is not supported. If 0, a default waveform that matches the category of waveform is chosen for known device types (see Remarks).
- intensity
-
Double
double
The intensity of the waveform, expressed as a value between 0.0 and 1.0.
- playCount
-
Int32
int
The total number of times to trigger the feedback. Applicable only to discrete waveforms.
The duration between the end of one playback and the start of the next. Must be greater than or equal to zero.
Returns
bool
true if the waveform was successfully triggered; false if no input has been received recently, the most recent input device does not support haptics, or the device does not support either waveform or other parameters.
This method also returns false if an intensity other than 1.0 is specified and the device does not support configuring intensity.
- Attributes
Remarks
When both waveform and waveformFallback are 0, a default discrete waveform is chosen: Hover for mouse and touchpad devices, or Click for pen devices.
When waveform is non-zero and waveformFallback is 0, the default fallback attempts to match the discrete or continuous category of waveform.
Default continuous waveforms are InkContinuous for pen devices; mouse and touchpad devices do not have a default continuous waveform.
The play count controls the total number of times the feedback is triggered. The method returns false if a play count other than 1 is specified and the device does not support configuring play count. Specifying multiple play counts is only applicable to discrete waveforms.
The replay pause interval controls the duration between the end of triggering one playback and the start of the next one. This value must be greater than or equal to zero. The method returns false if an interval other than 0 is specified and the device does not support configuring the interval.