Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing the vibration function in Windows 8 WinRT?

Is there an WinRT API in Windows 8 or Windows Phone 8 to use the vibration function?

like image 423
djcouchycouch Avatar asked Aug 03 '12 20:08

djcouchycouch


2 Answers

Try this: (Only works on Windows Phone!)

var vibrationTime = TimeSpan.FromMilliseconds(100);
Windows.Phone.Devices.Notification.VibrationDevice.GetDefault().Vibrate(vibrationTime);
like image 62
Galinho Avatar answered Oct 14 '22 14:10

Galinho


The leaked docs seem to mention the Microsoft.Devices.VibrateController class being available both in WP7 and WP8. I don't think there is something like that in WinRT though. I think tablets usually don't have a vibrator? Seems to be more like a feature of a phone that you might keep silenced in your pocket.

Some articles on vibrations

like image 45
Filip Skakun Avatar answered Oct 14 '22 12:10

Filip Skakun