xstroke PiScreen Raspberry Pi

Raspberry Pi with stroke and Gesture Recognition

If you are using a touchscreen with your Raspberry Pi, then this guide is for you.

Xstroke (Gesture recognition) is the perfect tool to help you get more out of your touhscreen. I am using a PiScreen

Gesture recognition allows you to draw "strokes" on your touchscreen, which get interpreted as commands or text. Xstroke allows these to be entered anywhere on the screen. In some cases, Xstroke can be used instead of a keyboard.


Xstroke Installation

Installing xstroke is very easy, just need to install some prerequisites, download xstroke and compile
Installing

pi@raspberrypi ~ $ sudo apt-get -y install libxft-dev libxpm-dev libxtst-dev
pi@raspberrypi ~ $ wget http://mirror.egtvedt.no/avr32linux.org/twiki/pub/Main/XStroke/xstroke-0.6.tar.gz
pi@raspberrypi ~ $ tar xfv xstroke-0.6.tar.gz
pi@raspberrypi ~ $ cd xstroke-0.6/
pi@raspberrypi ~ $ ./configure

We need to make a small edit to the Makefile, otherwise make will fail;

pi@raspberrypi ~ $ sed -i '/^X_LIBS = / s/$/ -lXrender -lX11 -lXext -ldl/' Makefile
pi@raspberrypi ~ $ make
pi@raspberrypi ~ $ sudo make install

 

PiScreen TFT Raspberry Pi

Menu shortcuts
We will install some menu items so we can start and stop xtroke within X.
Download the menu items from ozzmaker.com;

pi@raspberrypi ~ $ wget http://www.ozzmaker.com/piscreen/xstrokekill.desktop
pi@raspberrypi ~ $ wget http://www.ozzmaker.com/piscreen/xstroke.desktop

Then copy them to the appropriate location;

pi@raspberrypi ~ $ sudo cp xstrokekill.desktop xstroke.desktop /usr/share/applications/

Below you can see the location of the two scripts.
One to start xstroke and the other to kill the xstroke process
XstrokeMenu

 

 

After starting xstroke, an icon will appear on the task bar to the right. You will need to click on this icon to enable gesture recognition. XstrokeIcon1

The image below shows the icon when gesture recognition is enabled.

XstrokeIcon2

Default Gesture Set

 

Global Gesturesxstroke-global-gestures

Punctuationxstroke-punctuationLetter and Numbers
xstroke-letters-and-numbers

[wp_ad_camp_3]

34 thoughts on “Raspberry Pi with stroke and Gesture Recognition”

  1. Hi, I successfully complete this step:

    pi@raspberrypi ~ $ tar xfv xstroke-0.6.tar.gz

    And then get an error when trying to enter this:

    pi@raspberrypi ~ $ ./confgure

    Should it be ./configure…?

      1. I’ve tried running it from the X-terminal but gets automatically redirected to LXTerminal. It runs XStroke, without any messages or errors, but still no pencil icon.

  2. Hi,
    I tried to install xstroke but I can’t due to one error:

    gcc -I/usr/include/freetype2 -DXSTROKE_CONF_DIR='”/usr/local/etc/xstroke”‘ -g -O2 -o xstroke action.o action_item.o anchor_engine.o args.o backing.o bresenham.o brush.o control_win.o dir_engine.o feature.o fixed.o gesture.o grid.o grid_engine.o log.o matrix.o option.o raw_engine.o rec.o rec_callback.o rec_engine.o rec_history.o rec_lex.o rec_mode.o rec_parse.o regex_feature.o sprintf_alloc.o stroke.o tray.o xlp.o xlp_callback.o xlp_color.o xlp_timeout.o xlp_win.o xstroke.o -lXft -lm -lpthread -lXpm -lXtst
    /usr/bin/ld: backing.o: référence au symbole non défini «XRenderFindFormat»
    //usr/lib/arm-linux-gnueabihf/libXrender.so.1: error adding symbols: DSO missing from command line
    collect2: ld returned 1 exit status
    Makefile:292: recipe for target ‘xstroke’ failed
    make[1]: *** [xstroke] Error 1
    make[1]: Leaving directory ‘/home/pi/tools/xstroke-0.6’
    Makefile:230: recipe for target ‘all’ failed
    make: *** [all] Error 2

    Do you have any idea of the reason of this trouble?

    Thanks

      1. Same error here, on a fresh rasbian install. Something has changed with the dependencies and is now missing:

        /usr/bin/ld: backing.o: undefined reference to symbol ‘XRenderFindFormat’
        //usr/lib/arm-linux-gnueabihf/libXrender.so.1: error adding symbols: DSO missing from command line
        collect2: ld returned 1 exit status

        ld (the linker) is failing because XRenderFindFormat is no longer present in libxrender. I have the latest versions available installed:

        ii libxrender-dev:armhf 1:0.9.7-1+deb7u1 armhf X Rendering Extension client library (development files)
        ii libxrender1:armhf 1:0.9.7-1+deb7u1 armhf X Rendering Extension client library

      2. same error also after upgrade. But when upgrading I get a message that 19 packages were not upgraded.

  3. Same issue, latest raspian (sudo apt-get update AND sudo apt-get upgrade DONE yesterday)
    /usr/bin/ld: backing.o: undefined reference to symbol ‘XRenderFindFormat’
    //usr/lib/arm-linux-gnueabihf/libXrender.so.1: error adding symbols: DSO missing from command line
    collect2: ld returned 1 exit status
    Makefile:292: recipe for target ‘xstroke’ failed
    make[1]: *** [xstroke] Error 1
    make[1]: Leaving directory ‘/home/pi/xstroke-0.6’
    Makefile:230: recipe for target ‘all’ failed
    make: *** [all] Error 2

    I also have the latest libxrender
    ii libxrender-dev:armhf 1:0.9.7-1+deb7u1 armhf X Rendering Extension client library (development files)
    ii libxrender1:armhf 1:0.9.7-1+deb7u1 armhf X Rendering Extension client library

    Any path to follow?
    Thanks

    Guy

  4. Hi,

    I found a way around this, but this meant I had to change the Makefile. Replace the X_LIBS with

    X_LIBS = -lXrender -lX11 -lXext -ldl

    The fact that these libs are not defined here is probably caused by something else.

    Regards,
    Bas.

  5. Great tutorial! Just a note that the following command from above did not work for me… I went to the Makefile directly to append “-lXrender -lX11 -lXext -ldl” to “X_LIBS = ”

    Command:
    sed -i ‘/^X_LIBS = / s/$/ -lXrender -lX11 -lXext -ldl/’ Makefile

    Thanks 🙂

  6. This command [ sed -i ‘/^X_LIBS = / s/$/ -lXrender -lX11 -lXext -ldl/’ Makefile ] does not work for the lastest raspbian on a Pi B+ :-(.

      1. Did you try to do like Naglaa eid said (modifying the file with a text editor instead of using the command) ? I did it on my Pi B+ and it works

  7. Hi, wonderful guide!!!
    I have a problem…any time that i launch startx the desktop is very large and I can only see a big trash icon. Isn’t about the image on the guide. Anyone can help me?
    Many thanks
    Gianni

  8. Hello,
    I am trying to install it, but package seems no more available, there it is error message :
    pi@raspberrypi:~ $ wget http://mirror.egtvedt.no/avr32linux.org/twiki/pub/Main/XStroke/xtroke-0.6.tar.gz
    –2016-05-13 16:59:02– http://mirror.egtvedt.no/avr32linux.org/twiki/pub/Main/XStroke/xtroke-0.6.tar.gz
    Résolution de mirror.egtvedt.no (mirror.egtvedt.no)… 178.255.151.173, 2a02:20c8:2640::b2ff:97ad
    Connexion à mirror.egtvedt.no (mirror.egtvedt.no)|178.255.151.173|:80… connecté.
    requête HTTP transmise, en attente de la réponse… 404 Not Found
    2016-05-13 16:59:02 erreur 404 : Not Found.

    Is there anything to change in order to receive the package anyway ?

  9. ohhh dear! i’ve forgot one “s” in the file name… not xtroke-0.6.tar.gz but yes xstroke-0.6.tar.gz
    thanks for the tutorial, by the way 🙂

  10. Thanks for the guide. I was able to successfully install xstroke 0.6 on an old HP T1000 tablet computer. I did need to change a couple of steps. Since this isn’t a ARM processor, I chose to get the code from https://github.com/jeevesmkii/xstroke. I followed the other steps and everything proceeded successfully. This was installed on the Raspberry Pi Pixel for X86 that was attached to Issue 60 of The Magpi. Again thanks.
    Ian

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.