[patch] touch-as-mouse and key support for udev/EVDEV, Was:R |
Andreas Lausch / TBT
Guest
|
Hi,
What's the best way to get patches applied / stuff fixed ? attached is a preliminary patch. It's a little hackish, but it works so far. I added a few FIXMEs to the code.
Other thoughts: the current EVDEV code is broken by design, imho: 1. The code should keep track of values and only act upon SYN,0 (possibly drop for SYN,3). For a touch, the old code would result in: - Mouse/finger down - Mouse/finger move X (= drag right/left) - Mouse/finger move Y (= drag up/down) (SYN ignored) - Mouse/finger up (SYN ignored) The correct behaviour would be: - Store finger=1 - Store x=value - Store y=value - at SYN: Move to x,y and mouse/finger down (correct order is obvious) - Store finger=0 - at SYN: Mouse/finger up My hack just moves mouse/finger down to the end (SYN) and keeps the rest as-is. Same goes for keyboards: events should be emitted or dropped at SYN. EVDEV may send modifier+key in any order between 2 SYNs, SDL would act incorrectly in 1 of 2 cases. 2. Because of possibly too low buffer size, polling udev should be done async, if timing can't be guaranteed. For my app, this is done using PumpEvents() at random code points, but I don't really see why SDL doesn't pthread_start an "event worker". Best regards Andreas Lausch On 2015-09-29 22:18, Andreas Lausch / TBT wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||||||
|