是否MOUSE_WHEEL有最小差值它触发过吗? [英] Does MOUSE_WHEEL have a min delta value before it fires?

查看:179
本文介绍了是否MOUSE_WHEEL有最小差值它触发过吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有MOUSE_WHEEL增量值有些麻烦。这似乎是不会触发事件,除非我真的旋堰塞湖轮。这是有道理的,因为唯一的值,我得到范围为3-30。我希望能赶上1-3为好,因为,如果我只是旋转了几个缺口,没有触发和应用程序的感觉呆滞。

仅供参考我的机器上所有其他程序就感觉那些1型缺口旋转就好了,所以它不是鼠标。请问AS3不火,如果增量小于3?

下面是code

 私有函数handleMouseWheel(E:的MouseEvent):无效{
跟踪(e.delta);
    //输出总是多/小于+/- 3
}

私有函数handleStageInit(五:事件):无效{
    stage.addEventListener(MouseEvent.MOUSE_WHEEL,handleMouseWheel);
}
 

解决方案

AS3不具有车轮的灵敏度任何自定义值。

它的工作方式,我相信,依赖于两个物理鼠标 OS设置

>鼠标的
-

例如,在窗口的你的 ControlPanel控制设置的各种鼠标设置灵敏度 在滚轮选项卡,用户可以设置多少行(例如三角形)的车轮不为每个物理缺口。默认值是3。

目前的同时,每个物理鼠标有不同缺口敏感性,例如。你需要多少移动它登记在OS中的缺口。

我相信,SWF的容器也有一定的影响力一样,所以它可能会表现不同在不同的浏览器,并作为一个投影仪,并在你的IDE。

有关浏览器,大多数人似乎忽略闪存和收听/通过JavaScript的滚轮事件到闪存:

请参阅这些库:

<一个href="https://github.com/digi604/As3-Mouse-Wheel-Fixer">https://github.com/digi604/As3-Mouse-Wheel-Fixer

<一个href="http://labs.byhook.com/2010/04/09/flash-mouse-wheel-support/">http://labs.byhook.com/2010/04/09/flash-mouse-wheel-support/

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/

这篇关于是否MOUSE_WHEEL有最小差值它触发过吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆