I am having some trouble with MOUSE_WHEEL delta values. It seems like the event doesn't fire unless I REALLY spin the dammed wheel. Which makes sense because the only values I get range from 3-30. I was hoping to catch 1-3 as well because if I just spin a few notches, nothing triggers and the app feels sluggish.
FYI every other program on my machine feels those 1-notch spins just fine so it's not the mouse. Will AS3 not fire if the delta is less than 3?
Here is the code
private function handleMouseWheel(e:MouseEvent):void {
trace(e.delta);
// Output is always more/less than +/- 3
}
private function handleStageInit(e:Event):void {
stage.addEventListener(MouseEvent.MOUSE_WHEEL, handleMouseWheel);
}
AS3 doesn't have any customizable value for wheel sensitivity.
The way it works, I believe, is dependent on BOTH the physical mouse, and the OS settings.
For instance, in windows you set the sensitivity of various mouse settings in ControlPanel -> Mouse.
In the Wheel tab, the user can set how many lines (eg. delta) the wheel does for each physical notch. The default is 3.
At the same time, each physical mouse has different notch sensitivity, eg. how much you need to move it to register a 'notch' in the OS.
I believe the swf's container also has some influence as well, so it may behave differently in different browsers, and as a projector, and in your IDE.
For browsers, most people seem to bypass flash and listen/pass the JavaScript scroll wheel events into flash:
See these libraries:
https://github.com/digi604/As3-Mouse-Wheel-Fixer
http://labs.byhook.com/2010/04/09/flash-mouse-wheel-support/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With