openstf / minitouch

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

Support single touch event files #15

Open konradweiss opened 7 years ago

konradweiss commented 7 years ago

Some emulators do not have files supporting multitouch but single touch to emulate events. To support it the scoring was adapted to consider input files having that capability but still giving moultitouch the preference. Most important are two changes:

  1. State contains the event code attributes used to send the touch events depending on the property of the device.
  2. The function set_abs_configuration sets some information such as screen resolution and event code used for touches.
sorccu commented 7 years ago

Hmm, it seems to just patch the coordinate events, I don't think we should be sending the other events (like syn_mt_report) at all. Could cause issues if left like that. On Wed, Mar 29, 2017 at 5:24 Konrad Weiss notifications@github.com wrote:

Some emulators do not have files supporting multitouch but single touch to emulate events. To support it the scoring was adapted to consider input files having that capability but still giving moultitouch the preference. Most important are two changes:

  1. State contains the event code attributes used to send the touch events depending on the property of the device.
  2. The function set_abs_configuration sets some information such as screen resolution and event code used for touches.

You can view, comment on, or merge this pull request online at:

https://github.com/openstf/minitouch/pull/15 Commit Summary

  • Enable scoring for single touch devices such that certain emulators do not fail. Single touch devices get outscored by multitouch devices.
  • Adding event code to state of devices, a function to configure the movement event code and the screensize.
  • Fixes right scoring for multitouch devices

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openstf/minitouch/pull/15, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_QaGxut1EpmAQ8zhuPQGVa3_kOtCks5rqWxkgaJpZM4MsJZw .

konradweiss commented 7 years ago

Yes, I send the right event depending on the capabilities of the device. I will do a test if I can leave that command out for single touch devices and will do a new commit.

sorccu commented 7 years ago

I think I would kind of prefer if the events were not set dynamically, instead, the state would have a flag for the type (single/multi) and single touch would dispatch to a separate single-touch only method. That way it would be clearer what it does. There may be a need to add other methods later as well (e.g. stylus input which is a separate event device on some devices. On Wed, Mar 29, 2017 at 16:21 Konrad Weiss notifications@github.com wrote:

Yes, I send the right event depending on the capabilities of the device. I will do a test if I can leave that command out for single touch devices and will do a new commit.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/openstf/minitouch/pull/15#issuecomment-290005293, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_ZJqWQblRiF7bSoKO28gYAXJBF4sks5rqgaHgaJpZM4MsJZw .

konradweiss commented 7 years ago

I could define a is_multitouch in state and depending on that perform the touch with the ABS_MTPOSITION... or ABS_... events, if that is the the way you prefer it and better structures the project for your future extension?

konradweiss commented 7 years ago

Sorry, I was busy with a different project in the last month. I tried to interpret your suggestions in the correct manner and created different functions for single and multi touch events to remove the dynamically set event codes. I also removed syn_mt_report from the single_touch methods. As I don't know exactly which events are necessary, I did not dare to remove every event containing MT in the single touch methods. So if you want to remove more of them, tell me or just do it after pulling in case you accept the pull request.

Regards, Konrad

sorccu commented 7 years ago

The best way to see which events are required would be to use an OTG cable to connect a mouse to a device, and then check what events it sends with getevent.

On Mon, May 8, 2017 at 19:10 Konrad Weiss notifications@github.com wrote:

Sorry, I was busy with a different project in the last month. I tried to interpret your suggestions in the correct manner and created different functions for single and multi touch events to remove the dynamically set event codes. I also removed syn_mt_report from the single_touch methods. As I don't know exactly which events are necessary, I did not dare to remove every event containing MT in the single touch methods. So if you want to remove more of them, tell me or just do it after pulling in case you accept the pull request.

Regards, Konrad

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/openstf/minitouch/pull/15#issuecomment-299827544, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB-_ZrFSxDLLAJ2iCpe9HWgxye61oJMks5r3uoYgaJpZM4MsJZw .

gounthar commented 6 years ago

Is there any chance this MR will be merged someday? Or has minitouch.c evolved too far to merge? Thanks.

sorccu commented 6 years ago

I want to try using a mouse with an OTG adapter first.

gounthar commented 6 years ago

Got it, thanks.

gounthar commented 6 years ago

Is there anything I can do on my side? I have the OTG adapter and the mouse. Thanks.

koral-- commented 6 years ago

@gounthar you can try compiling minitouch with this PR applied and post your feedback here.

gounthar commented 6 years ago

For the time being, I have a problem with downloading libedev behind the corporate proxy. :-1: I will keep you posted.

sorccu commented 6 years ago

You might be able to use https://github.com/whot/libevdev instead, if you just replace one line in .gitmodules.

gounthar commented 6 years ago

Thanks @sorccu . Before reading your comment, I had changed it to https://anongit.freedesktop.org/git/libevdev.git/ . The first build is now finished. I now have to find how to include my version on an STF Docker image...

gounthar commented 6 years ago

@sorccu is there a documentation somewhere on how you pushed it on npm? Thanks.

sorccu commented 6 years ago

You'd have to use a different package name. Other than that, npm publish should do everything for you.

gounthar commented 6 years ago

Thanks a lot, I will give it a try.

gounthar commented 6 years ago

I recompiled, published, but this doesn't solve the mouse problem. ;-)

stf@stf-macmini:~$ adb shell /data/local/tmp/minitouch Note: device /dev/input/mice is not supported by libevdev Unable to find a suitable touch device

qmfrederik commented 5 years ago

I have a similar use case - in my scenario, and Android-x86 VM running on top of qemu/kubevirt, exposing a mouse and keyboard only.

I've rebased this branch on top off minitouch master and updated the submodule to the latest libevdev; but I get the same results as @gounthar .

I will probably working around this by getting qemu to provide a tablet/touchpad device, but thought I'd leave this here anyway.