Forum Diskio Pi

Another digital world is possible.

Vous n'êtes pas identifié(e).

#1 06-08-2018 11:34:38

Gaara14
Administrator

[Tutorial] Two finger touch for right click on Raspbian (2021 update)

Credit goes to @gadgetoid for finding the method, testing it, and confirming that it works in this thread. https://www.raspberrypi.org/forums/view … 2&start=25 I'm just adding some polish.

Tested with a Raspbian fresh install, 2018-06-27-raspbian-stretch and the 3rd prototype of Diskio Pi with ILITEK Multi-Touch-V3000 touch screen (13'3 capacitive)

Note: The Diskio Pi V1.2 has an upgraded touch screen. So, in step 2 and 4, replace "ILITEK Multi-Touch-V3000" with "ILITEK ILITEK-TP"

It should work with other brands with some little modifications.

1) install twofing

mkdir ~/temp
cd ~/temp
wget http://plippo.de/dwl/twofing/twofing-0.1.2.tar.gz

That should report that "twofing-0.1.2.tar.gz" was saved.

Now we'll add some needed packages, if any of these are already installed it's OK. We'll update first, and then install them with the following commands.

sudo apt-get update
sudo apt-get install build-essential libx11-dev libxtst-dev libxi-dev x11proto-randr-dev libxrandr-dev

Now that those are in place we can extract the downloaded twofing-0.1.2.tar.bz file and compile the binary using "make".

tar -xvzf twofing-0.1.2.tar.gz
cd twofing-0.1.2
make

Now copy "twofing" to /usr/bin

sudo cp twofing /usr/bin/

2) Next we need to create a .rules file in "/etc/udev/rules.d"

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

SUBSYSTEMS=="usb",ACTION=="add",KERNEL=="event*",ATTRS{idVendor}=="222a",ATTRS{idProduct}=="0001",SYMLINK+="twofingtouch",RUN+="/bin/chmod a+r /dev/twofingtouch"
KERNEL=="event*",ATTRS{name}=="ILITEK Multi-Touch-V3000",SYMLINK+="twofingtouch",RUN+="/bin/chmod a+r /dev/twofingtouch"


3) Install some packages to auto calibrate

sudo apt install xserver-xorg-input-evdev xinput-calibrator

4) Add an X configuration

sudo nano /usr/share/X11/xorg.conf.d/90-touchinput.conf

Section "InputClass"
    Identifier "calibration"
    Driver "evdev"
    MatchProduct "ILITEK Multi-Touch-V3000"
    MatchDevicePath "/dev/input/event*"
    Option "Emulate3Buttons" "True"
    Option "EmulateThirdButton" "1"
    Option "EmulateThirdButtonTimeout" "750"
    Option "EmulateThirdButtonMoveThreshold" "30"
EndSection


5) install udev rules :

sudo nano /etc/udev/rules.d/99-input-tagging.rules

ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", TAG+="systemd", , ENV{SYSTEMD_ALIAS}+="/sys/subsystem/input/devices/$env{ID_SERIAL}"


6) Application on startup :

nano ~/.config/pcmanfm/LXDE-pi/autostart

@/usr/bin/twofing

7) reboot

sudo reboot

test :

twofing --debug

or via SSH :

export DISPLAY=:0 && twofing --debug

You should see

pi@raspberrypi:~ $ export DISPLAY=:0 && twofing --debug 
twofing, the two-fingered daemon 
Version 0.1.2.20120708 

Input device name: "ILITEK Multi-Touch-V3000" 
XInput device id is 8. 
XInput device id for calibration is 8. 
Start calibration 
No calibration data found, use default values. 
Calibration: MinX: 1; MaxX: 16384; MinY: 1; MaxY: 9600 
Invert X Axis: No 
Invert Y Axis: No 
Swap Axes: No 
Calibration Matrix:     1.000000        0.000000        0.000000 
                       0.000000        1.000000        0.000000 
Grab Result: 0 
Reading input from device ... (interrupt to exit) 
Current window: 'pcmanfm' 
Use default profile.

and the menu appears.
[Ctrl+C] to interrupt.

Sources :
https://www.raspberrypi.org/forums/view … p?t=138575
http://www.markamc.co.uk/raspberry-pi-2 … uchscreen/

Hors ligne

#2 04-07-2020 19:06:07

belzebuteu
Moderator

Re : [Tutorial] Two finger touch for right click on Raspbian (2021 update)

Hi all,

This method doesn't work for me on my raspbian buster
In fact the last point to automatically start twofing.

Indeed, if i create a file named autostart in .config/lxsession/LXDE-pi/ my desktop doesn't appear at boot. Just right-clic (with a mouse) and i can launch a terminal.

So i have create a file here:
.config/autostart/twofing.desktop

[Desktop Entry]
Type=Application
Name=Twofing autostart
Comment=Start the twofing program
Exec=twofing --wait
StartupNotify=false

The option --wait is to wait ( yikes ) the desktop before launch the program.
It take maybe 1 minute to access to twofing.


----------
Post with the DiskioPi \o/

Dernière modification par belzebuteu (04-07-2020 19:08:13)

Hors ligne

#3 04-07-2020 19:16:54

Gaara14
Administrator

Re : [Tutorial] Two finger touch for right click on Raspbian (2021 update)

Hello belzebuteu, thanks for the update  smile

Hors ligne

#4 27-07-2021 22:20:41

jerometerrier
Membre

Re : [Tutorial] Two finger touch for right click on Raspbian (2021 update)

Hello all

i have find why the first method was not working.
in fact, when /etc/xdg/lxsession/LXDE-pi/autostart and  ~/.config/lxsession/LXDE-pi/autostart are existing,
only the local one is executed.

so i copy the first one

 cp /etc/xdg/lxsession/LXDE-pi/autostart ~/.config/lxsession/LXDE-pi/autostart

and add


@/usr/bin/twofing

to obtain

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@usr/bin/twofing

@gaara14, maybe you can modify the first post?

Hors ligne

#5 26-08-2021 15:21:53

Marius010783
Membre

Re : [Tutorial] Two finger touch for right click on Raspbian (2021 update)

Hello

Hello I have followed the tutorial is all nourmale except that it does not work. When I execute the command:
"twofing --debug"

export DISPLAY=:0 && twofing --debug
twofing, the two-fingered daemon
Version 0.1.2.20120708

Input device name: "ILITEK ILITEK-TP Mouse"
XInput device id is 7.
XInput device id for calibration is 7.
Start calibration
No calibration data found, use default values.
Calibration: MinX: 0; MaxX: 16384; MinY: 0; MaxY: 16384
Invert X Axis: No
Invert Y Axis: No
Swap Axes: No
Calibration Matrix:     1.000000    0.000000    0.000000
                        0.000000    1.000000    0.000000
Grab Result: 0
Reading input from device ... (interrupt to exit)

Apparently these lines are missing, I don't know if this is the cause of the malfunction:


Current window: 'pcmanfm'
Use default profile.

Cordialement,

Hors ligne

#6 28-08-2021 08:25:15

Gaara14
Administrator

Re : [Tutorial] Two finger touch for right click on Raspbian (2021 update)

Hello @Marius010783,

Sorry for the late !

Ok, I have found the error.
In fact, the touchscreen model has changed in the 1.2 version. (1.2B only, some are 1.2A, the ref. is inside the case)

Anyway, in steps 2 and 4, replace "ILITEK Multi-Touch-V3000" with "ILITEK ILITEK-TP"

You should see this:

twofing, the two-fingered daemon
Version 0.1.2.20120708

Input device name: "ILITEK ILITEK-TP"
XInput device id is 6.
XInput device id for calibration is 6.
Start calibration
No calibration data found, use default values.
Calibration: MinX: 0; MaxX: 16384; MinY: 0; MaxY: 16384
Invert X Axis: No
Invert Y Axis: No
Swap Axes: No
Calibration Matrix:     1.000000        0.000000        0.000000
                        0.000000        1.000000        0.000000
Grab Result: 0
Reading input from device ... (interrupt to exit)
Current window: 'pcmanfm'
Use default profile.

@jerometerrier Thanks ! I have updated the command.

Hors ligne

#7 07-09-2021 09:52:27

Marius010783
Membre

Re : [Tutorial] Two finger touch for right click on Raspbian (2021 update)

Merci merci,

Je vais tester tout ça de suite !!

Hors ligne

#8 08-09-2021 08:33:59

Gaara14
Administrator

Re : [Tutorial] Two finger touch for right click on Raspbian (2021 update)

A savoir aussi, il y a un autre logiciel appelé "Touchegg" qui peut être aussi testé.

https://github.com/JoseExposito/touchegg

Suivi de Touche, la configuration de touchegg
https://github.com/JoseExposito/touche

Les paquets de touche sont ici: https://github.com/JoseExposito/touche/ … /tag/1.0.7

Et pour le Raspberry Pi, choisir touche_1.0.7_armhf.deb

Ensuite, l'installation se fait comme suit : (non testé pour le moment, je vais le faire dans la journée)

$ sudo add-apt-repository ppa:touchegg/stable
$ sudo apt update
$ sudo apt install touchegg
$ sudo dpkg -i touche_1.0.7_armhf.deb

Hors ligne

Pied de page des forums

Propulsé par FluxBB 1.5.11