Raspberry Ri Touch Screen setup right click with twofing – Raspbian Jessie

Unfortunately, the Raspberry Pi 7 Touchscreen does not support right-click or long touch if used with Raspbian Jessie. You can add this functionality by using a two-finger touch on the Touchscreen with the program Twofing.

Raspberry Pi Touchscreen Rechtsklick rechte Maustaste two finger right click Raspbian Jessie

Contents

Install Twofing

  1. You need a few programs in order to compile Twofing. In case one of those programs is already installed apt-get will automatically recognize this.

    
    sudo apt-get update && sudo apt-get install build-essential libx11-dev libxtst-dev libxi-dev x11proto-randr-dev libxrandr-dev
    
  2. Download Twofing.

    wget http://plippo.de/dwl/twofing/twofing-0.1.2.tar.gz
  3. Extract the downloaded file.

    tar -xvzf twofing-0.1.2.tar.gz
  4. Navigate to the folder that was created during the extraction.

    cd twofing-0.1.2
  5. Start the compilation and install Twofing

    make && sudo make install
  6. Optional
    I used an original Raspberry Pi 7 Touchscreen with Raspberry Jessie and an error occured during the first start of Twofing.

    
    twofing, the two-fingered daemon
    Version 0.1.2.20120708
    
    /dev/twofingtouch: No such file or directory
    

    You can fix the error as following.
    Open the 70-touchscreen-egalax.rules file with the nano text editor.

    sudo nano /etc/udev/rules.d/70-touchscreen-egalax.rules

    Delete the complete content and add the following lines.

    
    KERNEL=="event*",ATTRS{name}=="FT5406 memory based driver",SYMLINK+="twofingtouch",RUN+="/bin/chmod a+r /dev/twofingtouch"
    

    Exit the text editor with CTRL+X and confirm the changes with Y

  7. Restart the Raspberry Pi.

    sudo reboot
  8. Delete the obsolete folder of Twofing in the home folder.

    rm ~/twofing-0.1.2
  9. Start Twofing in debug mode and test with two fingers if the right-click works on the Touchscreen.

    twofing --debug

    You can exit the program with CTRL+C.
    Raspberry Pi Touchscreen Rechtsklick rechte Maustaste two finger right click Raspbian Jessie

    When running the command through SSH and not directly on the Raspberry Pi, the command twofing --debug will not work. You must first set that Twofing uses the Touchscreen. Therefore, add the following command

    export DISPLAY=:0

    and restart Twofing afterwards.

    twofing --debug

    In case you connected an additional monitor through HDMI you need to check the index number of the Touchscreen. You can get the index numbers of all connected monitors using who.
    Source: http://raspberrypi.stackexchange.com/a/27881/14517

Twofing autostart

In order to not start Twofing after a restart manually you can add a autostart file.

  1. Navigate to the autostart folder of your home folder.

    cd ~/.config/autostart
  2. Create a file with the name twofing.desktop and open it.

    nano twofing.desktop
  3. Add the following text to the file.

    
    [Desktop Entry]
    Type=Application
    Name=Twofing
    Exec=twofing
    StartupNotify=false
    

    Exit the text editor with CTRL+X and confirm the changes with Y

Leave your vote

26 points
Upvote Downvote

Total votes: 19

Upvotes: 19

Upvotes percentage: 100.000000%

Downvotes: 0

Downvotes percentage: 0.000000%

Leave a Reply

Your email address will not be published.

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