Scroll wheel delta is inconsistent on different platforms (Lime)

I’m just using Lime, without OpenFL.

I noticed that through onMouseWheel, deltaY has different magnitudes on different platforms.
The only two targets I currently use are Windows and HTML5, so I’m not sure how the other ones behave.

  • Windows native: multiples of 1
  • Chrome and Opera: multiples of 100
  • Firefox: multiples of 3
  • Edge: multiples of 128

So my question is: is the only decent solution for me to only check whether the scroll is negative or positive?
The downside to this is that very fast scrolling will be limited to the event dispatch speed.

I just tested the mouse wheel event in Flash Player (without Haxe). I get multiples of 3.


1 Like

Yes! There’s actually an open issue for this, I ran into this myself, but I’m not sure what approach we should take:

One some platforms the value seems somewhat opaque. Pixels feels more valuable than lines, but you only get what you get.

We could estimate a pixel value per delta value on other platforms (like 100 or 128) or decide something else. I think Flash Player uses an OS-specific scroll value, which makes more sense before smooth touch scrolling became standard.

BTW, have you run into anything else in Lime that feels like the way it works is a bit clumsier than it could be, or like a method or two is missing? Since OpenFL is the primary “user” of Lime, I don’t always get to hear as much feedback, so any points on improving Lime are appreciated.

Hey! I’ve been wanting to say how much I admire what you do here. Thank you so much for everything!

I didn’t notice the open issue, thanks for pulling that up!
Personally I would prefer it to be standardized versus exposing the units, as there would still be discrepancies even knowing the units. While I’d be inclined to say it should follow Flash’s standards, you’re probably right that it’s a bit archaic now.

I’m glad it’s being considered though! I think for now I’ll clamp it to -1 to 1, though it’s not ideal.

Thanks for the question about my experience with using Lime! I think it’s a great question. My answer ended up being uncomfortably long for this post, so I’ve made a new topic for it:

1 Like