We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4850 - XInput relative motion incorrect with Wacom tablet
Summary: XInput relative motion incorrect with Wacom tablet
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.10
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-30 04:05 UTC by Jay Cornwall
Modified: 2019-12-03 12:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jay Cornwall 2019-10-30 04:05:29 UTC
Relative motion in the XInput backend is implemented through XI_RawMotion events. The backend currently assumes these events report relative motion at screen scale. A Wacom tablet instead reports absolute RawMotion events at much higher DPI:

Device 11
Class 2
        Range: 0.000000 - 44704.000000
        Resolution: 200000 units/m
        Mode: absolute
        Current value: 13423.000000

To fix this we could record the mode/range and emulate screen-scale relative motion from absolute XI_RawMotion events, if the screen scale is known.

Alternatively we could emulate relative motion through the the post-scaled absolute XI_Motion event when only absolute XI_RawMotion events are available. I think this makes more sense.

I could have a go at this but wanted to check if there are good reasons to use XI_RawMotion?