minitouch icon indicating copy to clipboard operation
minitouch copied to clipboard

Support single touch event files

Open konradweiss opened this issue 7 years ago • 19 comments

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.

konradweiss avatar Mar 28 '17 20:03 konradweiss

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 [email protected] 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:

  • https://github.com/openstf/minitouch/pull/15.patch
  • https://github.com/openstf/minitouch/pull/15.diff

— 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 .

sorccu avatar Mar 29 '17 06:03 sorccu

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.

konradweiss avatar Mar 29 '17 07:03 konradweiss

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 [email protected] 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 .

sorccu avatar Mar 29 '17 07:03 sorccu

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

konradweiss avatar Mar 29 '17 07:03 konradweiss

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

konradweiss avatar May 08 '17 10:05 konradweiss

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 [email protected] 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 .

sorccu avatar May 08 '17 10:05 sorccu

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

gounthar avatar May 21 '18 06:05 gounthar

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

sorccu avatar May 21 '18 06:05 sorccu

Got it, thanks.

gounthar avatar May 21 '18 06:05 gounthar

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

gounthar avatar May 29 '18 16:05 gounthar

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

koral-- avatar May 30 '18 00:05 koral--

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

gounthar avatar Jun 12 '18 10:06 gounthar

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

sorccu avatar Jun 12 '18 12:06 sorccu

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 avatar Jun 12 '18 13:06 gounthar

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

gounthar avatar Jun 12 '18 16:06 gounthar

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

sorccu avatar Jun 12 '18 16:06 sorccu

Thanks a lot, I will give it a try.

gounthar avatar Jun 12 '18 20:06 gounthar

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

gounthar avatar Jun 18 '18 11:06 gounthar

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.

qmfrederik avatar Nov 29 '18 12:11 qmfrederik