Hi guys- I've been a Debian guy for a lot of years and have bungled my way through many touchscreen interface installs (serial, usb, i2c, etc) mostly with either vendor-specific or the old evdev driver. I have a current Deb9 install on an x64 AMD processor with a USB 5-wire touchscreen, specifically registering with the eGalax Inc USB TouchController chipset (a pretty common aftermarket one), attached to a 1024x768 landscape display.
That said, matrix math sucks, unless you're a matrix math wizard. I did 3x3 and 4x4 transforms in high school, and I understand "some" of the affine rules because of some work I do with OpenCV, but I really don't think anyone should be expected to figure out a matrix transform to install a touchscreen on a Desktop PC.
In an earlier time, I would kill libinput and replace it with the evdev driver - except of recent, the evdev driver is broken in the regular distribution. (There is a "recompile-from-scratch-and-patch-if-you-dare" solution), but the distributed version does not perform the "SwapXY" or "SwapAxes" functions. I have no desire to install a compiler dev-environment on each of these PCs I'm working on just to get a driver patched. Aside from the security risks, it's a waste of valuable time.
This touchscreen kit requires me to rotate the touch 90 degrees clockwise, then flip X values (mirror over the Y axis, if you prefer) - (for the uninitiated, please refer to other posts/blogs about how to get started with xinput and setting the CTM's.)
I have found websites and man pages (yes, I did read the wiki and man pages) to EITHER rotate OR FLIP, but not both at one time.
For example, from one resource, if I set the CTM to 0 1 0 -1 0 1 0 0 1 (which is a rotate left 90 deg), my cursor moves up and down correctly, but when finger moves left, cursor moves right - thus I now need to perform a mirroring of X values (around Y axis).
Alternatively, if I set the CTM to a left-rotate (indicated as 0 -1 1 1 0 0 0 0 1) cursor follows finger left-right but now the cursor moves upwards when the finger moves downwards. For this mirroring is still needed but around the X (inverting the Y values)
This honestly destroyed a day's worth of time and I'm surprised it got out the door with as much as a debacle it is. What I would like is to hope that there are some very kind, wise and math-savvy individuals out there that would simply respond with the transform that has the rotation and the mirroring (either of the above examples) done for me, or if there is a real tool that will work for calibration, please point me to it. Oh yes, xinput-calibrator doesn't work with libinput, so no need to be suggesting that, thanks.
Kindest regards in all things linux!
Ted.