Thank you, aBUGSworstnightmare. The scan direction swap is an elegant solution to 180 rotate. It makes sense that it wouldn't work in a 90° rotate since the video adapter likely only scans in one direction.
The display_lcd_rotate option did rotate the display appropriately but predictably did not adjust touch input to match the screen orientation. However I was able to use xinput to adjust the coordinate transformation matrix to match.
For anyone trying Portrait Orientation (90 degree right rotation) in X on the Official Foundation 7" LCD touchscreen in Rasbian Stretch:
In /boot/config.txt add the line:
Create a new bash script called swapmouseaxis and put it in ~/ (don't forget to make it executable)
Code: Select all
#!/bin/bash
xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 1 0 -1 0 1 0 0 1/sw
Now edit /home/pi/.config/lxsession/LXDE-pi/autostart to add a call to the script by adding this line to the end:
If you're testing the xinput command in an SH session, you'll need to add "DISPLAY=:0" in order to select the correct local display.