Skip to content

wrong touch position in Debian 10 Buster (aarch64) #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AndroidDesigner opened this issue May 28, 2023 · 5 comments
Closed

wrong touch position in Debian 10 Buster (aarch64) #333

AndroidDesigner opened this issue May 28, 2023 · 5 comments

Comments

@AndroidDesigner
Copy link

AndroidDesigner commented May 28, 2023

Hello
I have a debian 10 buster touch panel and used the compositor-ng branch to be able to run my app (issue_328).
But I don't know why touch positions are wrong when I run the app (in both portrait & landscape).
for example, suppose I have a button in bottom-left of the screen. So if I click on it, nothing happens while if I click on bottom-right side of the screen, the button's event triggers.

I used sudo libinput debug-events to be able to check touched positions and it seems the (x,y) are correct (for example top-left shows 0/ 0 (0/ 0mm) and right-bottom shows 100/ 100 (1280/ 800mm)).
Also, $xrandr output:

xrandr
Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192
DSI-1 connected primary 1280x800+0+0 right (normal left inverted right x axis y axis) 0mm x 0mm
   800x1280      56.24*+

what is the problem?
Are you sure touch handler in the compositor-ng branch is correct?

@AndroidDesigner AndroidDesigner changed the title wrong touch position when using orientation argument wrong touch position when using landscape orientation May 28, 2023
@AndroidDesigner AndroidDesigner changed the title wrong touch position when using landscape orientation wrong touch position in Debian 10 Buster (aarch64) May 29, 2023
@AndroidDesigner
Copy link
Author

My touch screen works fine in the Desktop environment of my debian OS, but is wrong in the flutter app.
I used sudo libinput debug-events to log touch positions.
As I said, my touch panel is 1280*800 in landscape shape with a camera in top-center of it. So :

  • top-left side of the screen (relative to the camera) shows (0,0)
  • bottom-left side of the screen (relative to the camera) shows (0, 800).
  • top-right side of the screen (relative to the camera) shows (1280, 0).
  • bottom-right side of the screen (relative to the camera) shows (1280, 800).
    In the flutter app, it seems we have a 90 degree shift between physically touched position and affected position on the app.
    No recommendation?

@ardera
Copy link
Owner

ardera commented Jun 1, 2023

It's a bit weird, in the flutter-pi log in issue #328 (comment) it says the resolution is 800x1280, but xrandr says it's 1280x800 also somehow 800x1280, and says it's 1280x800.

Did you launch libinput from inside the desktop environment / while the desktop environment is running? Or from console, when no desktop environment was running?

How do you launch flutter-pi? Are you using -r <90/180/270> or -o something else?

When running, is the flutter app displaying in landscape or portrait mode?

@AndroidDesigner
Copy link
Author

AndroidDesigner commented Jun 1, 2023

I found the solution finally.
I read about the flutter-pi and found that it provides touch input support through the tslib library.
So I installed it and did a calibration by using ts_calibrate.
Then I added the below to the /etc/udev/rules.d/98-touchscreen-cal.rules path:

ATTRS{name}=="gt9xx", ENV{LIBINPUT_CALIBRATION_MATRIX}="0.0 -1.0 1.0 1.0 0.0 0.0"

And finally touch works in the flutter app too.

@ardera
Copy link
Owner

ardera commented Jun 1, 2023

Nice that you got it working!

flutter-pi uses libinput, but other than that it's correct :) I also have flutter_libinput_calibrator for this, but specifying an exact rotation matrix like you did is better

@AndroidDesigner
Copy link
Author

The flutter_libinput_calibrator is so useful too.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants