我在哪里可以找到关于如何在windows phone7上实现触觉反馈的文档?我想让手机在按下按钮时发出短暂的震动。
发布于 2010-11-19 22:12:27
基本上,你需要做的就是让手机震动:
VibrateController.Default.Start(TimeSpan.FromMilliseconds(200));我建议阅读this blog,因为它很好地解释了这一点。如果你还没有看过的话,other chapters也很有趣。
发布于 2011-04-09 07:07:56
我为我的按钮创建了一个振动类,这样就可以很容易地调用它。这是我的代码。如果你喜欢,请给我+1。
public class Vibration
{
public static void VibrateOnButtonPress()
{
Microsoft.Devices.VibrateController.Default.Start(TimeSpan.FromMilliseconds(50));
System.Windows.Threading.DispatcherTimer timer = new System.Windows.Threading.DispatcherTimer();
timer.Interval = new TimeSpan(0, 0, 0, 0, 200);
timer.Tick += (tsender, tevt) =>
{
var t = tsender as System.Windows.Threading.DispatcherTimer;
t.Stop();
Microsoft.Devices.VibrateController.Default.Stop();
};
timer.Start();
}
}发布于 2010-11-19 22:14:18
也许您可以使用XNA来设置"GamePad“的振动
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.input.gamepad.setvibration.aspx
我很好奇,如果你让它在silverlight中工作,请在你尝试后评论:-)
https://stackoverflow.com/questions/4225725
复制相似问题