Modifications

Sauter à la navigation Sauter à la recherche
2 452 octets ajoutés ,  19 juin 2016 à 20:15
Ligne 77 : Ligne 77 :     
{{ADFImage|RASP-PiTFT-Extra-22.png}}
 
{{ADFImage|RASP-PiTFT-Extra-22.png}}
 +
 +
== Démarrer X Windows sur PiTFT ==
 +
To enable booting straight to X windows on the PiTFT follow the steps below.  First make sure a display configuration which would conflict is not present by executing in a terminal on the Pi:
 +
 +
sudo mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf ~
 +
 +
Don't worry if the command fails with an error that the file doesn't exist.  This failure is normal and should happen on a good PiTFT install.  You can ignore it and move on.
 +
 +
Next run the command below to open the nano text editor as root and create the file {{fname|/usr/share/X11/xorg.conf.d/99-pitft.conf}}:
 +
 +
sudo nano /usr/share/X11/xorg.conf.d/99-pitft.conf
 +
 +
When the editor loads to a blank file, copy in the text below:
 +
 +
<nowiki>Section "Device"
 +
  Identifier "Adafruit PiTFT"
 +
  Driver "fbdev"
 +
  Option "fbdev" "/dev/fb1"
 +
EndSection</nowiki>
 +
 +
Then save the file by pressing '''Ctrl-O''' and then enter, and finally exit by pressing '''Ctrl-X'''.
 +
 +
The step above will create a configuration file which tells X windows that it should use the PiTFT framebuffer (located at /dev/fb1) by default when it runs.
 +
 +
At this point you can use the raspi-config tool to enable booting to desktop just like normal on the Pi.  Run the following command:
 +
 +
sudo raspi-config
 +
 +
Then pick the '''Enable Boot to Desktop/Scratch''' option and choose if you want to boot to the console, desktop, or scratch environment.  After exiting the tool and rebooting you should see the Pi load X windows on the PiTFT after (be patient it can take around 30 seconds to load).Obviously if you have a touchscreen, it cannot tell what finger you are pressing with. This means that all 'clicks' are left clicks. But if you want a right-click, you can do it.
 +
 +
Just add the following lines into your InputClass of {{fname|/etc/X11/xorg.conf.d/99-calibration.conf}} after the calibration section
 +
 +
<nowiki>Option "EmulateThirdButton" "1"
 +
Option "EmulateThirdButtonTimeout" "750"
 +
Option "EmulateThirdButtonMoveThreshold" "30"</nowiki>
 +
 +
Votre fichier pourrait ressembler à ceci
 +
 +
<nowiki>Section "InputClass"
 +
  Identifier      "calibration"
 +
  MatchProduct    "stmpe-ts"
 +
  Option  "Calibration"  "3800 120 200 3900"
 +
  Option  "SwapAxes"      "1"
 +
  Option "EmulateThirdButton" "1"
 +
  Option "EmulateThirdButtonTimeout" "750"
 +
  Option "EmulateThirdButtonMoveThreshold" "30"
 +
EndSection</nowiki>
 +
 +
Cela permet d'émuler le clique droit sur la souris lorsque le stylet est maintenu pendant 750 ms.
    
{{RASP-PiTFT-TRAILER}}
 
{{RASP-PiTFT-TRAILER}}
29 917

modifications

Menu de navigation