Smooth scrolling and button emulation
Sascha Hlusiak
saschahlusiak at arcor.de
Thu Oct 4 02:23:16 PDT 2012
Hi Peter,
On Donnerstag, 4. Oktober 2012 00:30:36 Peter Hutterer wrote:
> On Wed, Oct 03, 2012 at 07:17:08PM +0200, Sascha Hlusiak wrote:
> > In the case for legacy button scroll events, the server keeps track of
> > the accumulated scroll delta and after reaching 100, will generate a
> > XI1/legacy scroll button down/up sequence. Is there a way to reset that
> > server internal delta to 0 after scrolling stops? It seems that smooth
> > scrolling might leave that value at 99, which makes it impossible for
> > me to predict when the next legacy button scroll event will happen.
>
> no, not really. this is a missing API but I do wonder how useful this API
> would be. The scroll resolution is supposed to represent one unit of
> scrolling, so it should be hard to repeatedly accumulate 99 - that would
> just mean the resolution is too high, wouldn't it?
I did notice the effect when I used it and the effect would be the same if
resolution was set to e.g. 5.
> > In the case of the joystick module, where deflecting the axis generates
> > a whole scroll unit, followed by smooth scrolling, this results in
> > sometimes two units from the start.
>
> I'm not sure what you mean by "Followed by smooth scrolling". Once you
> enable smooth scrolling, you don't send button 4/5 presses anymore, only
> the valuator events. the rest is handled in the server. are you still
> setting button events as well?
I am not sending button events as well. When the axis is first deflected, I
send out exactly one unit (value 100 in my example) to force immediate
emulated button events. While the axis is deflected, I continue sending small
intervals, so after some time I continually get more emulated button events,
each time the value of 100 is reached. With button emulation I'd expect like
1 scroll unit a second, but the first scroll unit happens at a random time,
depending on where the counter was before.
But when first deflecting the axis, I sometimes get two emulated button events
right after each other.
Just a quick thought, would it be possible to use an absolute motion event
with a value of 0 to reset the internal delta? That wouldn't break ABI.
Cheers,
Sascha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.x.org/archives/xorg-devel/attachments/20121004/fd77d1a2/attachment.pgp>
More information about the xorg-devel
mailing list