Question

We have an AIR application that has been around for a while that uses mouse wheel, when I built it with the latest FB it's really not responding well. As a result, I built a new project that tests only the mouse wheel - it barely intermittently responds. Mouse wheel is detected maybe once a second. The delta seems to really jump.

package
{
    import flash.display.Sprite;
import flash.events.MouseEvent;

public class MouseWheel extends Sprite
{
    public function MouseWheel()
    {
        stage.addEventListener(MouseEvent.MOUSE_WHEEL, handler);
    }

    public function handler(event:MouseEvent):void{
        trace("Mouse Wheel" + event.delta);
    }
}
}

Output:

Mouse Wheel-1
Mouse Wheel1
Mouse Wheel-1
Mouse Wheel0
Mouse Wheel-6
Mouse Wheel5
Mouse Wheel-8
Mouse Wheel4
Mouse Wheel-8

In addition, is this mouse wheel fix regarded as "the fix" or is there a better solution?

https://github.com/digi604/As3-Mouse-Wheel-Fixer

Était-ce utile?

La solution

The problem is in the Mac OS settings. Recently a trackpad was purchased, and under "More Gestures" the selection "Swipe Between Pages" was enabled. For some reason, this setting enabled disrupts the Mouse Wheel for AS3, but does not affect it for any other application.

By deselecting this option, the Mouse Wheel works as expected.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top