minitouch icon indicating copy to clipboard operation
minitouch copied to clipboard

state.max_x and state.max_y not match the display size

Open lzj1991 opened this issue 7 years ago • 17 comments

the device is 1280480,but the output of banner.maxX and banner.maxY in touch/index.js is 480800. what should I do to map display coordinates to touch coordinates. what should I modify in code of stf project.

lzj1991 avatar Feb 08 '18 08:02 lzj1991

They often do not match the display size. It’s completely normal. You have to calculate the position you want to touch based on the actual screen size and the touchable area size.

sorccu avatar Feb 08 '18 08:02 sorccu

I don't konw which file should be modified. minitouch.c or touch/index.js? Can you help me ? It would be very nice

lzj1991 avatar Feb 08 '18 08:02 lzj1991

Based on what you’ve told me nothing needs to be modified. Please explain the exact issue you are having. What software are you using? STF? Do you have a device that doesn’t work? In what way does it not work? Which device?

sorccu avatar Feb 08 '18 08:02 sorccu

Yes, it is in STF. I hava a device which made in China,the touch point is not right. I used console.log then the device is 1280 480,but the output of banner.maxX and banner.maxY in touch/index.js is 480 800.

lzj1991 avatar Feb 08 '18 08:02 lzj1991

Which device is it? Run ‘adb devices -l’ and post the output here.

sorccu avatar Feb 08 '18 08:02 sorccu

D:\sources\autolog>adb devices -l List of devices attached 20080411 device product:magton_p1 model:magton device:magton-p1

lzj1991 avatar Feb 08 '18 12:02 lzj1991

I hava many android devices meet this minitouch problem,all of these android devices are used in car operating system. About half devices are normal,the others are meet the minitouch problem. could not touch the right point

lzj1991 avatar Feb 08 '18 12:02 lzj1991

we offers a wide variety of android operating system. such as the _picture. img_4409

lzj1991 avatar Feb 08 '18 12:02 lzj1991

Hmm... I’m not sure how expensive those are, but is there any chance you could donate one of the devices? That way I could take a better look and perhaps fix the issue.

sorccu avatar Feb 08 '18 19:02 sorccu

wuwu.....these devices do not really belong to me.
I will contact you as soon as I have a solution.

lzj1991 avatar Feb 09 '18 03:02 lzj1991

Hi,sorccu You note that the maximum X and Y coordinates may, but usually do not, match the display size.Need to work out a good way to map. But if I need to rotate 90° to achieve the mapping . (look at the following picture). What should be modified in stf ? is it touch/index.js ? Thanks! 1

lzj1991 avatar Feb 22 '18 12:02 lzj1991

I like the picture. I'm not sure if there's anything minitouch can do about this. However, you can create a special case for your device by following the comment I posted to https://github.com/openstf/stf/issues/813.

One thing though, please run adb shell wm size and adb shell dumpsys window (or maybe dumpsys display) and post the output here. Then run adb shell getevent -ilp and post the output here. If -l is not supported, remove it.

sorccu avatar Feb 23 '18 07:02 sorccu

@sorccu Thank you very much! I had resolved the problem by your suggestion. Now I have a new question! Is it possible that the minitouch could be used in linux device.

lzj1991 avatar Mar 03 '18 07:03 lzj1991

As long as there is a multitouch device it should work. The /dev locations might be different, though.

sorccu avatar Mar 03 '18 07:03 sorccu

Btw what did you end up doing? Is it something we should merge? Also if possible run the commands I posted earlier.

sorccu avatar Mar 03 '18 07:03 sorccu

I want to use stf to control the linux devices.Not android.

lzj1991 avatar Mar 03 '18 08:03 lzj1991

How do I get the infos of available devices at any time.

lzj1991 avatar Mar 05 '18 14:03 lzj1991