InputHapticsManager.TrySendHapticWaveform 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.
Overloads
| Name | Description |
|---|---|
| TrySendHapticWaveform(UInt16, UInt16) |
Attempts to trigger the specified waveform on the input device that most recently delivered input to the thread. The fallback waveform is used if the first waveform is not supported. |
| TrySendHapticWaveform(UInt16, UInt16, Double) |
Attempts to trigger the specified waveform, with the specified intensity, on the input device that most recently delivered input to the thread. The fallback waveform is used if the first waveform is not supported. |
TrySendHapticWaveform(UInt16, UInt16)
Attempts to trigger the specified waveform 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 TrySendHapticWaveform(unsigned short waveform, unsigned short waveformFallback) = TrySendHapticWaveform;
/// [Windows.Foundation.Metadata.Overload("TrySendHapticWaveform")]
bool TrySendHapticWaveform(uint16_t const& waveform, uint16_t const& waveformFallback);
/// [Windows.Foundation.Metadata.Overload("TrySendHapticWaveform")]
/// [Windows.Foundation.Metadata.Experimental]
bool TrySendHapticWaveform(uint16_t const& waveform, uint16_t const& waveformFallback);
[Windows.Foundation.Metadata.Overload("TrySendHapticWaveform")]
public bool TrySendHapticWaveform(ushort waveform, ushort waveformFallback);
[Windows.Foundation.Metadata.Overload("TrySendHapticWaveform")]
[Windows.Foundation.Metadata.Experimental]
public bool TrySendHapticWaveform(ushort waveform, ushort waveformFallback);
function trySendHapticWaveform(waveform, waveformFallback)
Public Function TrySendHapticWaveform (waveform As UShort, waveformFallback As UShort) 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).
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.
- 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.
See also
- TrySendHapticWaveform(UInt16, UInt16, Double)
- TrySendHapticWaveformForDuration(UInt16, UInt16, Double, TimeSpan)
- TrySendHapticWaveformForPlayCount(UInt16, UInt16, Double, Int32, TimeSpan)
- TryStopFeedback()
- KnownSimpleHapticsControllerWaveforms
Applies to
TrySendHapticWaveform(UInt16, UInt16, Double)
Attempts to trigger the specified waveform, with the specified intensity, 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 TrySendHapticWaveform(unsigned short waveform, unsigned short waveformFallback, double intensity) = TrySendHapticWaveform;
/// [Windows.Foundation.Metadata.Overload("TrySendHapticWaveformWithIntensity")]
bool TrySendHapticWaveform(uint16_t const& waveform, uint16_t const& waveformFallback, double const& intensity);
/// [Windows.Foundation.Metadata.Overload("TrySendHapticWaveformWithIntensity")]
/// [Windows.Foundation.Metadata.Experimental]
bool TrySendHapticWaveform(uint16_t const& waveform, uint16_t const& waveformFallback, double const& intensity);
[Windows.Foundation.Metadata.Overload("TrySendHapticWaveformWithIntensity")]
public bool TrySendHapticWaveform(ushort waveform, ushort waveformFallback, double intensity);
[Windows.Foundation.Metadata.Overload("TrySendHapticWaveformWithIntensity")]
[Windows.Foundation.Metadata.Experimental]
public bool TrySendHapticWaveform(ushort waveform, ushort waveformFallback, double intensity);
function trySendHapticWaveform(waveform, waveformFallback, intensity)
Public Function TrySendHapticWaveform (waveform As UShort, waveformFallback As UShort, intensity As Double) 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.
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.
- 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 method returns false if specifying an intensity other than 1.0 and the device does not support configuring intensity.
See also
- TrySendHapticWaveform(UInt16, UInt16)
- TrySendHapticWaveformForDuration(UInt16, UInt16, Double, TimeSpan)
- TrySendHapticWaveformForPlayCount(UInt16, UInt16, Double, Int32, TimeSpan)
- TryStopFeedback()
- KnownSimpleHapticsControllerWaveforms