locked
Mouse Move Event not firing frequently when the mouse is moving quickly? RRS feed

  • Question

  • I'm having a problem hooking up to the mouse move event in the multipoint SDK. I'd love to have this solved super-soon, because I'm trying to use multipoint in a game competition going on right NOW! The problem is that the events seem to fire if I move the mouse slowly and in small increments. If I move the mouse quickly, the events seem to cease firing. Here's some sample code that I've added to the default example in the v1.5 SDK:

     


            private Random rand = new Random();
            private Rectangle colRect = new Rectangle();

            /// <summary>
            /// This is event handler for window "Loaded" Event.
            /// All MultiPoint initialization should happen on this event.
            /// </summary>
            void MultipointWindow_Loaded(object sender, RoutedEventArgs e)
            {
                // initialize the MulitPoint system
                MultipointSdk.Instance.Initialize(this);

                colRect.Width = 50;
                colRect.Height = 50;
                MainCanvas.Children.Add(colRect);

                MultipointDeviceMove += new RoutedEventHandler(ChangeColor);
            }

            void ChangeColor(object sender, RoutedEventArgs e)
            {
                byte[] randRGB = new byte[3];
                rand.NextBytes(randRGB);
                colRect.Fill = new SolidColorBrush(Color.FromRgb(randRGB[0], randRGB[1], randRGB[2]));
            }

    In the XAML, I named my canvas MainCanvas, so I add a little rect to it and change its color when the event fires. I find that when I move the mouse slowly and in small increments, I can see the colour changing while I move it. However, when I start moving the mouse quickly, the box stops changing colour at all, indicating that the events are no longer arriving. I'm using VS2008 SP1 on a Windows 7 64-bit machine.

     

    I would really appreciate help soon!

     

    Thanks in advance.

     

    --- Notes I'm writing as I try different things follow...

    As an interesting aside, I've found that the Mouse Down event does fire when the mouse is moving quickly. I can press the left mouse button and click as fast as possible while moving the mouse and the event will still fire, but the mouse move event will not.

     

    Another interesting note: the behaviour is identical whether I'm adding a handler to MultipointDeviceMove, MultipointMouseMoveEvent, or MultipointPreviewMouseMoveEvent.

    Also, the behaviour is the same regardless of whether I'm adding an event handler to

    • Edited by aardvarkk Friday, April 23, 2010 9:50 PM Additions
    Friday, April 23, 2010 9:39 PM

Answers

  • I've found the solution -- it was the mouse! I was using an Ikari SteelSeries Optical mouse.

     

    http://www.steelseries.com/int/products/mice/ikari_optical/information

     

    I tried another mouse and it worked perfectly. The Ikari SteelSeries would not send events on either high or low DPI mode. Weird, but seems fixed for now by switching mice!

    • Marked as answer by aardvarkk Friday, April 23, 2010 10:21 PM
    Friday, April 23, 2010 10:21 PM