openstf / minitouch

Minimal multitouch event producer for Android.
Other
633 stars 233 forks source link

Minitouch fails if ABS_MT_POSITION_X is no supported event code #14

Closed konradweiss closed 6 years ago

konradweiss commented 7 years ago

I am currently working on a web emulator where I'm using a strange web emulator where the evdev responsible for screen interaction in /dev/input/ is not supporting the ABS_MTPOSITION... eventcodes. Probably because this emulator does not support multitouch.

I was able to modify the minitouch code such that ABS_... event codes are used iff ABS_MTPOSITION... is not supported. If it is ok with you I would like to clean up my code a bit and contribute by creating a pull request? Do you have any requirements or suggestions how I should handle multiple possible /dev/input files that would then be accepted. What I was Thinking about: 1) Accept a device in consider_device if one of the two methods is supported and giving ABS_MT_POSITION the preference 2) Check through all devices and and only if no ABS_MT_POSITION device is found check a second time and accept devices with ABS_X support. 3) 1) + an arg in the main that can be set to also allow ABS_X devices

sorccu commented 7 years ago

You could possibly use the score system to match non-multitouch devices in a single run, but assigning them a lower score. If that low score ends up being highest, then it would be used automatically. Changes in the state struct would most likely be required, but that's OK.

I would very happily accept a PR that adds singletouch (=mouse/pointer) support, as long as it plays well with the existing code and reasonably attempts to respect the current formatting style.

sorccu commented 6 years ago

Let's close this to focus on #15. I've been wanting to take a look at it for a long time but haven't had the time.