版權聲明:本文為博主原創文章,轉載請注明出處。 https://www.cnblogs.com/YaoYing/p/12105771.html
顯示屏(觸摸屏)設置
屏幕旋轉
修改/boot/config.txt
文件
sudo vim /boot/config.txt
根據需求在文件最后一行添加其中一條語句
display_rotate=0 旋轉0度
display_rotate=1 旋轉90度
display_rotate=2 旋轉180度
display_rotate=3 旋轉270度
最后重啟設備即可
觸摸旋轉
如果顯示屏是觸摸屏,那么顯示旋轉的同時也需對觸摸功能進行旋轉,否則會導致觸摸位置不正確。
安裝libinput
sudo apt-get install xserver-xorg-input-libinput
在/etc/X11/
下創建xorg.conf.d
目錄 (如果該目錄存在,直接跳過該操作)
sudo mkdir /etc/X11/xorg.conf.d
復制/usr/share/X11/xorg.conf.d/40-libinput.conf
文件到剛剛創建的目錄下
sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
修改touchscreen
部分,根據需求在最后一行添加其中一條語句
90 度旋轉: Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"
180度旋轉: Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1"
270度旋轉: Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"
最后重啟設備即可
更新日期20191227
如有錯誤之處,請評論或者私信指出,非常感謝!