Thanks — this is exactly the key detail we needed:
✳️ You rotated the screen 90°, but touch behaves as if it’s still in the previous orientation — it’s off by 90°, as if the coordinate system didn’t rotate with the screen.
That means the calibration matrix is not correctly rotating the touchscreen input to match the display rotation.
Sway doesn't rotate touch inputs automatically; you must provide the correct calibration matrix that rotates touch coordinates to match each display orientation.
✅ Fully Working Setup for 1920×1080 Screen
✅ No scaling
✅ Just coordinate rotation
✅ One keybinding for each direction
✅ Works in Sway
👇 Use this:
🔧 Find names first:
Get your touchscreen device name:
bash
swaymsg -t get_inputs
Find your screen output name:
bash
swaymsg -t get_outputs
For example:
text
eDP-1 = your screen name
1386:1234:Goodix_Capacitive_TouchScreen = your touch input
🧠 Explanation
We're rotating the coordinate space from (x, y) in landscape to (1 - y, x) in portrait, etc. These are normalized transformations, no need for scaling.
Touch near the top of the screen — does the pointer appear exactly under your finger?
Compare between modes (left, right, normal, inverted)
If it works, the cursor/trail should follow perfectly in every orientation.
🧨 Still Doesn't Work?
Check live status:
bash
swaymsg -t get_inputs | grep -A 20 "input"
See if the calibration_matrix is applied correctly.
Also test Wayland touch input mapping with:
bash
sudo libinput debug-events
Touch the screen and see if events are registered — raw input coming through may help debug what Sway is doing with the calibration.
🏁 Conclusion
✅ Yes — in landscape and portrait, ONLY the coordinate system orientation has to rotate
🔃 Aspect ratio should not affect it — just rotation
⚙️ The matrix has to match the rotation exactly
Let me know:
the exact commands you tested
whether touch is rotated 90° clockwise or 90° counterclockwise
if it’s offset vertically or horizontally
… and I’ll provide fine-tuned updated values or debugging help.