Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


On Tuesday, 7 November 2017 05:21:38 PST,Jan-Marek Glogowski wrote:

Thanks for the info. It'll definitely be handy at some time.

I found https://doc.qt.io/qt-5/qwheelevent.html#angleDelta, which even
has a little example and which I kind of copied. The larger problem is
to understand, what the LO VCL event expects.

Just to point out that the code snippet that you point to is not fully 
correct, because angleDelta may return value less than 8. This is common on 
modern touchpad when you move finger slowly, and that's the root clause why you 
don't feel right when using touchpad.

One way to resolve this is to follow the text above the example:  
"cumulatively adding the delta" and trigger based on a certain value (not 
necessary 120). Still, trigger threshold should be a factor of 120, because 
low-precision mouse wheel will generate 120 per click.

Just take your implementation as an example, since you intent to scroll 3 line 
per click, you may convert it to 40 unit per line so user can get more fine-
grained control if they're using touchpad or high-precision mouse. And keep 
track of the remainder of delta and add it to the delta value for the next qt 
wheel event.

Regards,
Xuetian


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.