ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.74k stars 815 forks source link

MouseWheel event delta ignores OS setting #14795

Open n0samu opened 10 months ago

n0samu commented 10 months ago

Describe the bug

Consider the following code:

var mouseListener = new Object();
mouseListener.onMouseWheel = function(delta){
    trace(delta);
}
Mouse.addListener(mouseListener);

On Windows, the default scroll delta is 3 (see #14550 and #5767) but Ruffle still reports a delta of 1. Changing the setting does not change what Ruffle reports, either.

Expected behavior

The delta reported by Flash Player always matches the OS setting, at least on Windows.

Content Location

ScrollDeltaTest.zip

Affected platform

Desktop app

Operating system

Windows 10

Browser

No response

Additional information

No response

n0samu commented 10 months ago

Testing this a bit more, I noticed that in both Flash Player and Ruffle, when the scroll wheel is flicked quickly enough, the reported delta can be a multiple of the normal value. I observed values as high as 8 in Ruffle and as high as 24 (3*8) in Flash. So I guess we should be multiplying the received delta by the OS's current "base" delta setting.