4 Replies Latest reply on Jul 9, 2007 11:56 AM by jimmit

    IE  vs FF Mouse Move  Event Issues !

    levancho Level 3
      these problems are not very imperative until there is no requirement for such as task to implement for example, user session timeout,handler

      1) question:
      with addition of latest High Sensitive Mouses on the market, my question is how realistic is to rely on Mouse_Move event not firing every other second, meaning : every time someone walk across the hallway , or if table shakes a little etc ...
      what I mean is that in IE at least mouse Event fires almost every other second, plus
      it leaks through the browser, meaning if I have flex app listening for mouse_Move and I have browser minimumized
      it still receives mouse move events,if I for example open control panel or my documents folder etc ... so it seems that I have to completely stop moving mouse (which is almost not possible if I have a shaky table and laser mouse :))
      now its not same for Firefox (it does not capture mouse move events outside of its instance , meaing if FF is minimumized)
      is that expected behavior?

      Maybe there can be a extra parameter for mouse move event that sets a sensitivity of when should this event fire, for example with parameter MIN_10_PX it should fire when mouse moves more than 10px .?




        • 1. Re: IE  vs FF Mouse Move  Event Issues !
          Mitek17 Level 1
          I wouldn't worry about that. The system should be able to cope with mouse events event if they start appearing 10 times faster. And anyway they are coming from hardware interrupt, so you can't do much about the fact of their existence.

          You can place a tolerance check in your mouse event handler and if pointer is still in the tolerance area just discard this event.

          Cheers,
          Dmitri
          • 2. IE  vs FF Mouse Move  Event Issues !
            jimmit
            I'm having problems with the Mouse Wheel which may be related. I want only my Flex app to receive the mouse wheel event when the mouse is over the app, but the browser always gets it too and scrolls the page. It's really annoying and I CAN'T FIND ANYTHING on it.

            I tried setting up the event handler in MXML and in AS.

            MXML:
            mouseWheel="numChange(event);"

            AS:
            addEventListener(MouseEvent.MOUSE_WHEEL, numChange);

            Both work, but they still have the same problem with the browser still getting the event. Is there anyway to control whether or not other applications see the mouse events?



            levancho: I would keep a set of variables with the old coordinates and then find the distance from there and compare it in your mouse move handler.

            i.e. - Have an OldX and OldY and put something like if(sqrt((X - OldX)^2+(Y-OldY)^2) > 5) {

            That way the mouse would have to (in this example) move 5 pixels instead of 1.

            I think it's better for Adobe to support the most precision and allow the programmer to discard some events if he/she wants less precision.
            • 3. Re: IE  vs FF Mouse Move  Event Issues !
              levancho Level 3
              jimmit : for mouse wheel problem have you tried disabling it ouside of flex, meaning inside wrapper html with javascript?
              that might work,
              • 4. Re: IE  vs FF Mouse Move  Event Issues !
                jimmit Level 1
                levancho: Thanks for the suggestion. I was able to get it to work the way I wanted using javascript.