Input events on X have an old world and a new world
https://utcc.utoronto.ca/~cks/space/blog/unix/XInputOldAndNew [utcc.utoronto.ca]
2020-06-18 01:48
One of the important consequences of this split between core input events and XIE events is that events that look identical at the core input event level (for example, as shown by xev) may be different at the XIE level (as interpreted by libXi and then toolkit libraries, and perhaps as shown by xinput). This means that some programs will treat them exactly the same because they’re indistinguishable and some programs may react to them differently. This can cause rather odd issues, but that’s a story for another entry.
Also: https://utcc.utoronto.ca/~cks/space/blog/linux/XInputGtkScrollPuzzle