For most mice, 1 'scroll' on windows with a scroll wheel results in a change of 1 delta value, which scrolls 3 lines by default. However, some mice and Windows (8/10/11) precision touchpads support much (120 times as much) higher precision, with 3 lines being equivalent to 120 delta values.
Currently, Scintilla appears to ignore these higher delta values, and simply acts as if 120 high resolution delta values are equivalent to 1 delta value on a normal mouse, and scrolls 3 lines once these 120 delta values have been hit.
By supporting high resolution scrolling, we could scroll line-by-line on touchpads: each 40 high resolution deltas would be 1 line by default. This would make scrolling much smoother on touchpads; note that the same amount of finger movement would still result in 3 lines of scrolling, although this time stopping on any of the 2 other lines would also be possible with smaller movements.
Likewise, support for high resolution scrolling would also allow for very smooth horizontal scrolling. By simply interpreting the raw delta values , due to horizontal scrolling supporting pixel-based offsets, it is possible to create a very smooth scrolling experience for touchpads on Windows, as opposed to the current horizontal scrolling which happens at a fixed speed on touchpads. By purely interpreting these values (which only required a few lines of code), I got very smooth scrolling, complete with proper velocity and inertia as those are computed by Windows before it provides the delta values to the application.
If useful, I would be happy to provide a proof of concept for how this would work; I have partially written one already. Although I must warn that that code is not production-ready. If more explanation is needed, I would be happy to provide it.
This seems a bit confused. Windows defines
WHEEL_DELTA
to always be 120.Any change should behave sensibly when the user has chosen to scroll by page in Settings which is seen in the code as
WHEEL_PAGESCROLL
.For some devices, like Precision Touchpads,
WHEEL_DELTA
can be 1 and is given in increments of 1. See: https://learn.microsoft.com/en-us/windows/win32/w8cookbook/windows-precision-touchpad-devices#mitigationOn a side note, I noticed that on touch screens (in SciTE), line by line scrolling already works as described in this feature request. At least when testing it using Microsoft Remote Desktop on a smartphone, with touch screen (emulation) mode, as my device does not have such a screen.
WHEEL_DELTA
is a preprocessor definition in theWinUser.h
file from the Windows SDK:Seems high resolution scrolling need to be manually enabled in manifest:
https://learn.microsoft.com/en-us/windows/win32/w8cookbook/windows-precision-touchpad-devices
https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#highResolutionScrollingAware
Its worse than that with Logitech mouse drivers checking an allow-list.
https://groups.google.com/g/scintilla-interest/c/4khpih1uHRk/m/WQBdIct7CwAJ