openstf / minitouch

Minimal multitouch event producer for Android.
Other
639 stars 236 forks source link

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

Open lzj1991 opened 6 years ago

lzj1991 commented 6 years ago

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.

sorccu commented 6 years ago

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.

lzj1991 commented 6 years ago

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

sorccu commented 6 years ago

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?

lzj1991 commented 6 years ago

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.

sorccu commented 6 years ago

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

lzj1991 commented 6 years ago

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

lzj1991 commented 6 years ago

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 commented 6 years ago

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

sorccu commented 6 years ago

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.

lzj1991 commented 6 years ago

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

lzj1991 commented 6 years ago

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

sorccu commented 6 years ago

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.

lzj1991 commented 6 years ago

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

sorccu commented 6 years ago

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

sorccu commented 6 years ago

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

lzj1991 commented 6 years ago

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

lzj1991 commented 6 years ago

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