首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >wp7触觉反馈

wp7触觉反馈
EN

Stack Overflow用户
提问于 2010-11-19 22:04:47
回答 3查看 2.3K关注 0票数 13

我在哪里可以找到关于如何在windows phone7上实现触觉反馈的文档?我想让手机在按下按钮时发出短暂的震动。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2010-11-19 22:12:27

基本上,你需要做的就是让手机震动:

代码语言:javascript
复制
VibrateController.Default.Start(TimeSpan.FromMilliseconds(200));

我建议阅读this blog,因为它很好地解释了这一点。如果你还没有看过的话,other chapters也很有趣。

票数 18
EN

Stack Overflow用户

发布于 2011-04-09 07:07:56

我为我的按钮创建了一个振动类,这样就可以很容易地调用它。这是我的代码。如果你喜欢,请给我+1。

代码语言:javascript
复制
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();
        }
    }
票数 5
EN

Stack Overflow用户

发布于 2010-11-19 22:14:18

也许您可以使用XNA来设置"GamePad“的振动

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.input.gamepad.setvibration.aspx

我很好奇,如果你让它在silverlight中工作,请在你尝试后评论:-)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4225725

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档