Windows 10中的单一游戏鼠标只有在移动

时间:2015-08-14 00:25:51

标签: c# xaml windows-store-apps windows-10 monogame

我有Windows应用程序的monogame(3.4)XAML应用程序(Win10上的VS2012)。在我的游戏更新()中,我调用附加代码来接收toutch事件。在Windows 8 / 8.1中一切正常,但在Windows 10中我必须按住按钮并移动鼠标几次以获得ButtonState.Pressed - 对于最终用户来说,这看起来像鼠标根本不工作。我该如何处理这个错误?

鼠标事件接收代码:

        MouseState st = Mouse.GetState();
        if (st.LeftButton == ButtonState.Pressed)
        {
            if (prevMouseState == ButtonState.Released)
            {
                prevMouseValX = st.X;
                prevMouseValY = st.Y; 
                pushEvent(EVT_POINTER_DOWN, (int)(st.X - mScrBiasX), (int)(st.Y - mScrBiasY), 1, 0);
            }
            else
            {
                if (Math.Abs(st.X - prevMouseValX) > 2 || Math.Abs(st.Y - prevMouseValY) > 2)
                    pushEvent(EVT_POINTER_MOVE, (int)(st.X - mScrBiasX), (int)(st.Y - mScrBiasY), 1, 0);
            }
            prevMouseState = ButtonState.Pressed;
        }
        if (st.LeftButton == ButtonState.Released)
        {
            if (prevMouseState == ButtonState.Pressed)
            {
                pushEvent(EVT_POINTER_UP, (int)(st.X - mScrBiasX), (int)(st.Y - mScrBiasY), 1, 0);
            }
            prevMouseState = ButtonState.Released;
        }

1 个答案:

答案 0 :(得分:0)

答案是使用Monogame的最后一个开发版本 - 来自 - (并使用VS2013-2015构建win 8.1二进制文件)