[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg
Subject: emit "smooth scrolling/pixel perfect" events
From: dustin <dustin.bensing () googlemail ! com>
Date: 2014-12-29 19:07:31
Message-ID: 1419880051.3677.0 () smtp ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi,
i recently started to play around with the input facilitys of X. My
goal is to develop a remote control for my PC and for that purpose i
want to control the mouse with an android tablet. (Maybe other embeded
devices)
I found a few ways to do this namely xtest and uinput/evdev (and
untested xlib/xcb). Both working out of the box but i think i'll stick
with uinput/evdev cuz i think this approach should work with
libinput(wayland) as well? One problem arises that i can't circumvent
and this is the scrolling. my first implementation works by simply
emitting button 4/5 events like what ordinary mouse wheels do (looking
at xev xinput tools) but what i am rally looking for is emitting
"smooth scroll events"/"pixel perfect scrolling" (whatever this means).
I came across some articles from Peter Hutterer talking about this and
that Gnome implemented this. One can see this in live action via
touchpad and the epiphany webbrowser. What i discovered was, that a
client program has to catch XI2 events (XIDeviceEvent)and watch for
XI_Motion and its valuators. But i really don't know how to emit these?
with uinput/evdev even if i am emiting EV_REL, REL_WHEEL events and not
button 4/5 events i got ordinary scrolling. what is the "right way" to
emit these XIDeviceEvent/XI_Motion events (if these are really the ones
i am looking for)
what i was seeing from xinput --test-xi2 for ordinary mouse wheels was
EVENT type 17 (RawMotion)
device: 2 (10)
detail: 0
valuators:
flags:
2: -1.00 (-1.00)
EVENT type 15 (RawButtonPress)
device: 2 (10)
detail: 5
valuators:
flags: emulated
EVENT type 16 (RawButtonRelease)
device: 2 (10)
detail: 5
valuators:
flags: emulated
As i understand this right the first XI_RawMotion is the "now" the
regular new event and the button presses are for compatibility and can
be ignored cuz of the "emulated" flag
the valuator 2 means
Class originated from: 10. Type: XIValuatorClass
Detail for Valuator 2:
Label: Rel Vert Wheel
Range: -1.000000 - -1.000000
Resolution: 1 units/m
Mode: relative
if i scroll with my touchpad i get
EVENT type 17 (RawMotion)
device: 2 (13)
detail: 0
valuators:
flags:
3: 4.00 (4.00)
there i have a valuator 3 which i guess means Rel Vert Scroll regarding
to this
Class originated from: 13. Type: XIValuatorClass
Detail for Valuator 3:
Label: Rel Vert Scroll
Range: 0.000000 - -1.000000
Resolution: 0 units/m
Mode: relative
So the difference must somehow be with the different valuators. If so i
just don't know how i can influence this with uinput/evdev. Maybe its
only doable with xlib/xcb/xtest etc. i don't know.
all i want is to simulate the "pixel perfect smooth scrolling" i get
from regular laptop touchpads so that apps who respond to this will do
from my application.
best regards,
Dustin Bensing
[Attachment #5 (text/html)]
<div>Hi,</div><div><br></div><div>i recently started to play around with the input \
facilitys of X. My goal is to develop a remote control for my PC and for that purpose \
i want to control the mouse with an android tablet. (Maybe other embeded \
devices)</div><div><br></div><div>I found a few ways to do this namely xtest and \
uinput/evdev (and untested xlib/xcb). Both working out of the box but i think i'll \
stick with uinput/evdev cuz i think this approach should work with libinput(wayland) \
as well? One problem arises that i can't circumvent and this is the scrolling. my \
first implementation works by simply emitting button 4/5 events like what ordinary \
mouse wheels do (looking at xev xinput tools) but what i am rally looking for is \
emitting "smooth scroll events"/"pixel perfect scrolling" (whatever this means). I \
came across some articles from Peter Hutterer talking about this and that Gnome \
implemented this. One can see this in live action via touchpad and the epiphany \
webbrowser. What i discovered was, that a client program has to catch XI2 events \
(XIDeviceEvent)and watch for XI_Motion and its valuators. But i really don't know how \
to emit these? with uinput/evdev even if i am emiting EV_REL, REL_WHEEL events and \
not button 4/5 events i got ordinary scrolling. what is the "right way" to emit these \
XIDeviceEvent/XI_Motion events (if these are really the ones i am looking \
for)</div><div><br></div><div>what i was seeing from xinput --test-xi2 for ordinary \
mouse wheels was</div><div><br></div><div>EVENT type 17 (RawMotion)</div><div> \
device: 2 (10)</div><div> detail: 0</div><div> \
valuators:</div><div> flags: </div><div> \
2: -1.00 (-1.00)</div><div><br></div><div>EVENT type 15 \
(RawButtonPress)</div><div> device: 2 (10)</div><div> \
detail: 5</div><div> valuators:</div><div> flags: \
emulated</div><div><br></div><div>EVENT type 16 (RawButtonRelease)</div><div> \
device: 2 (10)</div><div> detail: 5</div><div> \
valuators:</div><div> flags: emulated</div><div><br></div><div>As i \
understand this right the first XI_RawMotion is the "now" the regular new event and \
the button presses are for compatibility and can be ignored cuz of the "emulated" \
flag</div><div><br></div><div>the valuator 2 \
means </div><div><br></div><div>Class originated from: 10. Type: \
XIValuatorClass</div><div> Detail for Valuator 2:</div><div><span \
class="Apple-tab-span" style="white-space:pre"> </span>Label: Rel Vert \
Wheel</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Range: \
-1.000000 - -1.000000</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>Resolution: 1 units/m</div><div><span \
class="Apple-tab-span" style="white-space:pre"> </span>Mode: \
relative</div><div><br></div><div>if i scroll with my touchpad i \
get</div><div><br></div><div>EVENT type 17 (RawMotion)</div><div> \
device: 2 (13)</div><div> detail: 0</div><div> \
valuators:</div><div> flags: </div><div> \
3: 4.00 (4.00)</div><div><br></div><div>there i have a valuator 3 which i \
guess means Rel Vert Scroll regarding to this</div><div><br></div><div>Class \
originated from: 13. Type: XIValuatorClass</div><div> Detail for \
Valuator 3:</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>Label: Rel Vert Scroll</div><div><span \
class="Apple-tab-span" style="white-space:pre"> </span>Range: 0.000000 - \
-1.000000</div><div><span class="Apple-tab-span" \
style="white-space:pre"> </span>Resolution: 0 units/m</div><div><span \
class="Apple-tab-span" style="white-space:pre"> </span>Mode: relative \
</div><div><br></div><div>So the difference must somehow be with the different \
valuators. If so i just don't know how i can influence this with uinput/evdev. Maybe \
its only doable with xlib/xcb/xtest etc. i don't know.</div><div><br></div><div>all i \
want is to simulate the "pixel perfect smooth scrolling" i get from regular laptop \
touchpads so that apps who respond to this will do from my \
application.</div><div><br></div><div>best regards,</div><div>Dustin Bensing</div>
[Attachment #6 (text/plain)]
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic