Différences entre versions de « RASP-PiTFT-Gesture »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 43 : Ligne 43 :
  
 
== Utiliser ==
 
== Utiliser ==
To use xstroke I highly recommend using a plastic stylus instead of your finger. Also [[RASP-PiTFT-Touch|calibrate the touchscreen for X-Windows so you have the best control over the cursor possible]].
+
Pour utiliser xstroke nous recommandons chaudement l'utilisation d'un stylet en plastique (stylus) à la place de vos doigts. Faites également [[RASP-PiTFT-Touch|une calibration de l'écran tactile sous X-Windows afin d'obtenir un contrôle du curseur le plus précis possible]].
  
{{ambox-stop|text=Don't use a ballpoint pen or sharp metal stylus as it could scratch or damage the touchscreen!}}
+
{{ambox-stop|text=N'utilisez pas un bic ou stylo a bille qui pourrait griffer ou endommager la partie tactile et même votre écran!}}
  
Start X-Windows on the PiTFT and open the LXDE menu by clicking the icon in the lower left corner. Scroll up to the '''Accessories''' menu at the top and notice the new '''XStroke''' and '''XStroke Kill''' commands.
+
Démarrez X-Windows sur le PiTFT et ouvrez le menu de LXDE en cliquant sur le coin en bas à gauche. Faites défiler le menu **** Scroll up to the '''Accessories''' menu at the top and notice the new '''XStroke''' and '''XStroke Kill''' commands.
  
  

Version du 22 septembre 2014 à 18:04


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Introduction

Avec la partie tactile du PiTFT et xstroke, il est possible d'entrer du texte dans une application en dessinant des caractères simplifiés sur l'écran!

Cette technique d'entrée par geste est appelée "Gesture Input" en anglais.

Voyez la vidéo de démonstration ci-dessous montrant l'usage de xstroke (Vidéo par Tony DiCola, anglais):

{{#Widget:Iframe |url=http://www.youtube.com/embed/k8NW-1QFjBU |width=420 |height=315 |border=0 }}

Installation

XStrobe n'a pas été activement maintenu ces dernières années et il n'existe pas de paquets binaires à installer directement. Il est cependant très facile de compiler cet outil en suivant les instructions ci-dessous. Crédit à mwilliams03 (arobase) ozzmaker.com pour ces instructions d'installation.

Pour commencer, il faut installer les quelques dépendances nécessaire en entrant les commandes suivantes sur un terminal de votre Pi:

sudo apt-get -y install build-essential libxft-dev libxpm-dev libxtst-dev

Maintenant, il faut télécharger et compiler xstrobe avec les instructions suivantes:

cd ~
wget http://mirror.egtvedt.no/avr32linux.org/twiki/pub/Main/XStroke/xstroke-0.6.tar.gz
tar xfv xstroke-0.6.tar.gz
cd xstroke-0.6
./configure
make
sudo make install

Si les commandes ci-dessus fonctionnent correctement alors xstrobe devrait être installé sur votre Pi. Si vous constatez un message d'erreur alors faites une vérification attentive afin de vérifier l'installation des dépendances et essayez encore.

Une fois xstroke installé, vous aurez besoin d'ajouter des entrées dans le menu pour démarrer et arrêter xstrobe. Exécutez les commandes suivantes pour installer ces raccourcis dans le menu:

wget https://github.com/adafruit/PiTFT_Extras/raw/master/xstroke.desktop
wget https://github.com/adafruit/PiTFT_Extras/raw/master/xstrokekill.desktop
sudo cp xstroke*.desktop /usr/share/applications/

Utiliser

Pour utiliser xstroke nous recommandons chaudement l'utilisation d'un stylet en plastique (stylus) à la place de vos doigts. Faites également une calibration de l'écran tactile sous X-Windows afin d'obtenir un contrôle du curseur le plus précis possible.

Démarrez X-Windows sur le PiTFT et ouvrez le menu de LXDE en cliquant sur le coin en bas à gauche. Faites défiler le menu **** Scroll up to the Accessories menu at the top and notice the new XStroke and XStroke Kill commands.


Click the XStroke menu option to start xstroke. You should see a small pencil icon appear on the bottom right side of the screen. The pencil icon means xstroke is running, however by default it's not yet looking for gesture input.


Open an application that takes text input, such as LXTerminal. To enable gesture input click the xstroke pencil icon. You should see the pencil turn green and the text 'abc' written over top of the icon. You might need to click the icon a few times to get the click to register in the right spot.


When xstroke is looking for gesture input you can drag the mouse cursor in a gesture anywhere on the screen to send specific key strokes. Here's a picture of the possible gestures you can send:

RASP-PiTFT-Gesture-00.png
Crédit: Carl Worth pour l'image ci-dessus

To draw a gesture from the above image, press anywhere on the screen, start from the circle in the gesture, and follow the gesture pattern towards the arrow. As you draw a gesture you should see a blue line displayed that shows what you've drawn. Lift up the stylus when you get to the end of the gesture at the arrow. If xstroke recognizes the gesture it will send the appropriate key press to the active window. Try drawing a few characters from the image above to get the hang of writing gestures.


A few very useful gestures are backspace (which deletes a character), return/enter, and space. To draw a backspace gesture just draw a line going from the right side of the screen to the left side. The gesture for return/enter is a diagonal line from the top right to bottom left. Finally a space is a straight line from the left to the right.


Note that when xstroke is looking for gestures you might not be able to click or control the cursor as you normally would expect. To stop xstroke's gesture recognition carefully press the xstroke pencil icon again until the 'abc' text disappears. I've found this process can be a little finicky as the icon is very small and any movement will be interpreted as a gesture. Use a light touch and try a few times to click the icon.


If you get stuck completely and can't disable xstroke by clicking the icon, connect to the Raspberry Pi in a terminal/SSH connection and run 'killall xstroke' (without quotes) to force xstroke to quit. The normal way to stop xstroke is to navigate to the Accessories -> XStroke Kill command, but you might not be able to do that if xstroke is listening for gesture input.


Have fun using xstroke to control your Pi by writing gestures on the PiTFT screen!


Source: Adafruit PiTFT - 2.8" Touchscreen Display for Raspberry Pi
Créé par LadyAda pour AdaFruit Industries.
Augmenté par Meurisse D. pour MCHobby

Traduction réalisée par Meurisse D pour MCHobby.be.

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com