|
From: Mojca M. <moj...@gm...> - 2012-01-09 21:07:21
|
Hello,
With help of some additional Ethan's hints ... I'm attaching the patch
for scrolling to the left/right (it might need some minor editing
before applying).
There is only one "problem": scrolling is way too fast. The minimum
amount of scrolling up/down is approximately 45 pixels (but usually it
is much more: that's just a bare minimum) which amounts to 10% of
vertical plotting area. In any other application I can scroll for
single pixels. The value of event->delta() in
m_eventHandler->postTermEvent(GE_buttonpress, 0, 0, event->delta()
> 0 ? 4 : 5, 0, 0);
is 2, but that delta value probably doesn't propagate anywhere, so
even if trackpad sends 20, the graph probably still moves for the same
amount as if it sends 2.
It is almost the same situation for horizontal scrolling. I'm unable
to generate minimum events, but the x delta is also 2 and the graph
moves for approximately 10%. However it is almost impossible to move
for less than 50-100%. A comfortable horizontal scroll moves the graph
for approximately 120%. Sliding from left to the right of my trackpad
(a single move) takes me 27 screens further away from center (one
screen is 640 pixels, so 17k pixels away).
The original idea of trackpad (the way how it works in other
applications) is that a single move should take you approximately 1
(monitor) screen apart, which means that scrolling movements could
easily be 10-40 times slower (depending on how you define "slower"
since those scrolling values are probably not propagated anyway).
My measurements might also be a tiny bit biased. At the moment I'm
working with Qt 4.7 which is not properly supported on Lion. I need to
install 4.8 first before complaining any further.
But I think that the main problem/difference with other mouses and
operating systems is that:
- they generate pretty stepwise scrolling
- nobody cares about moving webpage 1 pixel further
- it is very uncomfortable to make, say, 20 steps in a row with a
single movement
while on mac the scrolling seems to be extremely precise and generates
tons of events to move just for a fraction of a screen. And that
discrepancy makes a weird experience without taking amount of
scrolling into account.
... and oh, wait! The very funny part is that after this patch,
horizontal scrolling started working in X11 automatically as well.
That came as a pure surprize.
(I'm now working on zooming, but I will need some extra help there anyway.)
Mojca
|