Attached is a patch that enables Xinput2 API for processing mouse-movement.
No new functionality is implemented.

Notes:
-I refactored/moved the x11 touch input setup stuff since it also gets used
for the mouse
-touchpad events were implemented in Xinput 2.1, but touchscreen events are
in ver 2.2
 I simply made 2.2 the minimum requirement. I don't think it's worth it to
test for both versions
 and it seems to be what other projects (eg: GTK) are doing.

Important:
Xorg apparently does not allow using both the legacy API and Xinput2 for
the same event class.
So enabling listening for XI_Motion events causes the MotionNotify events
to stop.
Hence, this patch _only_ grabs the mouse-movement events in Xinput2 so that
allegro has access to touchpad events we can add later in the future.
All other inputs + window + mouse events are all still being handled by the
legacy API.

Testing:
- allegro5 builds with and without xinput2 support
- mouse example programs and ALLEGRO_MOUSE_EVENT members all work for
legacy and XInput2 versions.
- pointer and mouse-wheel acceleration work for mouse and touchpad
- hot-plugging USB mouse works and simultaneous use with touchpad works

Everything behaved as expected for me.

Please review and consider for addition.

Thanks,
Pho75

Attachment: patch
Description: Binary data

_______________________________________________
Allegro-developers mailing list
[email protected]
https://mail.gna.org/listinfo/allegro-developers

Reply via email to