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 2712

Summary: [patch] Multitouch support for evdev input via mtdev
Product: SDL Reporter: Tobias Himmer <provisorisch>
Component: *don't know*Assignee: Gabriel Jacobo <gabomdq>
Status: WAITING --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: amaranth72, gabomdq, mtweber
Version: HG 2.1   
Hardware: ARM   
OS: Linux   
Attachments: Adds multitouch support for evdev input via mtdev
add evdev touch support

Description Tobias Himmer 2014-09-02 11:45:21 UTC
Created attachment 1858 [details]
Adds multitouch support for evdev input via mtdev

The proposed patch will implement multitouch support for the evdev input module, currently used by the Raspberry PI.
mtdev is added as an optional dependency. It will only be used for devices reported to be touchscreens. Without it, no multitouch device is supported.

A few other things that would be changed in the existing behavior:
 * The udev module will additionally report touchscreen devices.
 * There won't be separate events for x and y movements. They get cached and reported on the next SYN_REPORT.
 * Non-event devices (like /dev/input/mouse0) will be ignored. Previously they have been read and erroneously interpreted as event devices.

Multitouch coordinates are currently reported in window/screen coordinates - not normalized between 0.0 and 1.0 - to match the X11 behavior. (Bug 2307)

This is tested by sending multitouch events to the kernel via uinput as I do not have an actual multitouch device.
Comment 1 Gabriel Jacobo 2014-09-02 12:27:29 UTC
Thanks, this is great! I'll be reviewing this patch after 2.0.4 is out.
Comment 2 Alex Szpakowski 2014-09-02 13:42:41 UTC
(In reply to Tobias Himmer from comment #0)
> Multitouch coordinates are currently reported in window/screen coordinates -
> not normalized between 0.0 and 1.0 - to match the X11 behavior. (Bug 2307)

That doesn't match the Android/iOS/Mac/Windows behaviour or the SDL documentation or public header file comments, though.
Comment 3 Michael Weber 2015-05-09 01:34:21 UTC
Created attachment 2152 [details]
add evdev touch support

I didn't realize somebody already worked on this, but here is my version of the patch that adds support for multitouch for evdev.

This version matches the 0.0 -> 1.0 span for x and y coordinates by looking up the min/max values of the input device via ioctl.
Comment 4 Sam Lantinga 2017-08-14 05:11:37 UTC
Is there a reason to use the mtdev support over the raw evdev support? Should we use mtdev and fall back to evdev if it's not available?