linwebs

林林.台灣 | Linwebs - 隨手記

將Linux 觸控螢幕對應到正確的螢幕

在尚未設定之前,若連接兩個以上的顯示器,使用觸控螢幕時,會橫跨兩個螢幕來觸控,所以須將觸控螢幕對應到正確的螢幕上,觸控時才不會有問題

1. 輸入 xrandr 指令查看已連接的螢幕,筆記型電腦螢幕在以下範例為 LVDS1

/* EX: */
$ xrandr
Screen 0: minimum 8 x 8, current 3286 x 1080, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+312 (normal left inverted right x axis y axis) 310mm x 170mm
   1366x768      59.98*+
   1280x720      59.74  
   1024x768      60.00  
   1024x576      60.00    59.90    59.82  
   960x540       60.00    59.63    59.82  
   800x600       60.32    56.25  
   864x486       60.00    59.92    59.57  
   640x480       59.94  
   720x405       59.51    60.00    58.99  
   680x384       60.00  
   640x360       59.84    59.32    60.00  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+1366+0 (normal left inverted right x axis y axis) 600mm x 340mm
   1920x1080     60.00*+  50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1600x1200     60.00  
   1680x1050     59.88  
   1400x1050     59.95                                                                                                                                                                       
   1280x1024     75.02    60.02                                                                                                                                                              
   1440x900      59.90                                                                                                                                                                       
   1280x960      60.00                                                                                                                                                                       
   1152x864      75.00                                                                                                                                                                       
   1280x720      60.00    50.00    59.94                                                                                                                                                     
   1024x768      75.03    70.07    60.00                                                                                                                                                     
   832x624       74.55                                                                                                                                                                       
   800x600       72.19    75.00    60.32    56.25                                                                                                                                            
   720x576       50.00                                                                                                                                                                       
   720x576i      50.00                                                                                                                                                                       
   720x480       60.00    59.94                                                                                                                                                              
   720x480i      60.00    59.94                                                                                                                                                              
   640x480       75.00    72.81    66.67    60.00    59.94                                                                                                                                   
   720x400       70.08                                                                                                                                                                       
VGA1 disconnected (normal left inverted right x axis y axis)                                                                                                                                 
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

2. 輸入 xinput --list 指令查看已連接的裝置,筆記型電腦的觸控式螢幕在以下範例為 LVDS1

/* EX: */
$ xinput --list
⎡ Virtual core pointer                          id=2    [master pointer  (3)]                                                                                                                
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]                                                                                                                
⎜   ↳ Atmel Atmel maXTouch Digitizer            id=11   [slave  pointer  (2)]                                                                                                                
⎜   ↳ ETPS/2 Elantech Touchpad                  id=14   [slave  pointer  (2)]                                                                                                                
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]                                                                                                                
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]                                                                                                                
    ↳ Asus Wireless Radio Control               id=6    [slave  keyboard (3)]                                                                                                                
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]                                                                                                                
    ↳ Power Button                              id=8    [slave  keyboard (3)]                                                                                                                
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]                                                                                                                
    ↳ ASUS USB2.0 Webcam: ASUS USB2.0           id=10   [slave  keyboard (3)]                                                                                                                
    ↳ Asus WMI hotkeys                          id=12   [slave  keyboard (3)]                                                                                                                
    ↳ AT Translated Set 2 keyboard              id=13   [slave  keyboard (3)]

3. 輸入 xinput map-to-output

指令將觸控螢幕對應到螢幕,以下範例為將 id=11 的觸控螢幕對應到 LVDS1的螢幕

/* EX: */
$ xinput map-to-output 11 LVDS1
建立時間:2018/3/18 AM 4:00
修改時間:2018/9/16 PM 1:28
作者: Linwebs

bookmark熱門隨手記標籤