[how to] enable long touch as right click

The official Raspbery Pi touch display

43 posts   Page 1 of 2   1, 2
by chris_c » Fri Sep 25, 2015 1:02 pm
odds on you don't have an /etc/X11/xorg.conf if not its okay just to create this fragment...

/etc/X11/xorg.conf
Code: Select all
Section "InputClass"
   Identifier "calibration"
   Driver "evdev"
   MatchProduct "FT5406 memory based driver"

   Option "EmulateThirdButton" "1"
   Option "EmulateThirdButtonTimeout" "750"
   Option "EmulateThirdButtonMoveThreshold" "30"
EndSection


(re)start X and you should find that a long press behaves like a right click, time to throw your mouse out?

Enjoy!
Posts: 147
Joined: Sun May 06, 2012 10:23 am
by PeterO » Fri Sep 25, 2015 1:08 pm
Useful tip. 8-)
I remember the days of /etc/X11/xorg.conf :D
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
User avatar
Posts: 3393
Joined: Sun Jul 22, 2012 4:14 pm
by gadgetoid » Tue Sep 29, 2015 10:39 am
Fantastically useful tip. Worked a treat on Raspbian Wheezy, but for some reason it doesn't work on Jessie.

Code: Select all
xinput list-props 9


Shows the settings have taken effect, but the right menu is nowhere to be found!
Posts: 145
Joined: Wed Mar 07, 2012 9:58 pm
by PeterO » Tue Sep 29, 2015 10:46 am
gadgetoid wrote: but the right menu is nowhere to be found!

Does it still work with a mouse or has the right menu been removed ?
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson
User avatar
Posts: 3393
Joined: Sun Jul 22, 2012 4:14 pm
by gadgetoid » Tue Sep 29, 2015 11:09 am
PeterO wrote:
gadgetoid wrote: but the right menu is nowhere to be found!

Does it still work with a mouse or has the right menu been removed ?


Haha! Nothing that drastic! There's still a right menu which works with the mouse.
Posts: 145
Joined: Wed Mar 07, 2012 9:58 pm
by chris_c » Tue Sep 29, 2015 11:39 am
I had a quick look at systemdOS but couldn't get it working nicely without systemd-udev so gave up... (happy with wheezy until a more up to date version of Linux is available)

You might want to check that the device name is still the same as in the config you might be seeing right button settings for a device that doesn't exist.

check that one of
Code: Select all
xinput list --name-only

matches
Code: Select all
MatchProduct "FT5406 memory based driver"

in the config fragment.
Posts: 147
Joined: Sun May 06, 2012 10:23 am
by MikeDunn » Tue Sep 29, 2015 9:03 pm
Hmmm - just added this to Jessie, but it seems not to work ?

Anyone got a working right-click on the touchscreen with Jessie ?

Mike
Posts: 78
Joined: Wed Jul 01, 2015 6:58 pm
by ulix » Wed Sep 30, 2015 2:09 pm
No,
The same here!
Posts: 65
Joined: Sat Apr 14, 2012 6:11 pm
by philkingmagpi » Wed Sep 30, 2015 4:25 pm
Same here – worked great on Wheezy but not Jessie. The device names do match (FT5406 memory based driver), so it doesn't seem to be that. Also, I noticed that when I do long-press in Jessie, a document icon appears under my finger.
Posts: 16
Joined: Wed Sep 30, 2015 9:36 am
by eggster » Thu Oct 01, 2015 4:46 pm
Confirmed, this does not work with Jessie
Posts: 15
Joined: Thu May 31, 2012 4:35 am
by ulix » Fri Oct 02, 2015 6:51 pm
Hello,
is there no one which is more experienced and knows how to change it to right click? (When I do a long press, there appears a document on the mouse.)
cheers
Posts: 65
Joined: Sat Apr 14, 2012 6:11 pm
by dragonlost » Thu Oct 15, 2015 8:19 pm
Hello.

I have exactly the same problem on Raspbian jessie Official.
Nobody has a solution for the official touch screen?

I have more problem to solve it to operate the tablet raspberry
Posts: 5
Joined: Thu Sep 24, 2015 9:47 pm
by sandhan_pi_hacker » Fri Oct 16, 2015 5:54 am
I also tried these settings on raspbian jessie...but it doesn't seem to work.
Posts: 1
Joined: Fri Oct 16, 2015 5:51 am
by JimmyN » Sun Oct 25, 2015 5:55 pm
I'm using Jessie and it doesn't work for me either.
Code: Select all
Linux rpi2 4.1.11+ #822 PREEMPT Fri Oct 23 16:14:56 BST 2015 armv6l GNU/Linux

And when I try "xinput list --name-only" it gives me a command not found. Using "locate" I have no xinput anywhere, though I do have lxinput, but that only seems to change the mouse settings (speed, acceleration, etc)

What am I missing? From the previous posts it seems I should still have xinput with Jessie.
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA
by lilgman » Wed Nov 04, 2015 2:39 pm
@JimmyN It seems that xinput isn't installed by default. You can install it with
Code: Select all
sudo apt-get install xinput


I think this may be a Debian Jessie problem. See http://forums.debian.net/viewtopic.php?f=7&t=115567 and http://superuser.com/questions/992917/touchscreen-right-click-emulation-doesnt-work

If anyone figures out a solution, I would love to know about it!
Posts: 8
Joined: Wed Nov 04, 2015 2:26 pm
Location: Lesotho, Africa
by pumpkinpi » Mon Nov 23, 2015 3:07 am
This is a really key thing for me too. Would love to get it working.

PPi
Posts: 113
Joined: Fri Apr 18, 2014 7:11 pm
by pdream » Wed Dec 02, 2015 2:42 pm
Thanks , it works with my raspbian wheezy !
Posts: 2
Joined: Wed Dec 02, 2015 2:27 pm
by BBMECH7 » Wed Jan 13, 2016 12:44 pm
So i can confirm also not getting right click option in Jessie, I noticed something though

Code: Select all
xinput list-props 9


did not work for me.

Code: Select all
xinput list


showed my touch screen was listed as #8 so i changed the 9 to an 8 and i got a list of properties.

xinput was also not installed as default in Jessie, an easy fix.

Code: Select all
xev


Showed the I never got any thing other than a 'button 1' being pressed no 'button 3' ever.
I was also able to use:

Code: Select all
xinput set-prop


To change the various options for the 3rd button and see the changes by doing 'list-props' but again no change in 'xev' showing anything other than button 1. :?

The changes showed in list-props but does that mean that are effective now or they need a restart of x?

To further add to my confusion I tried to burn a fresh install of the latest Wheezy from here and it doesn't initialize the screen on power up like Jessie did. Is there something more that needs done to Wheezy?
Posts: 6
Joined: Tue Mar 11, 2014 3:03 pm
by BBMECH7 » Fri Jan 15, 2016 12:36 am
ok so i will answer my own questions for the sake of others.

wheezy needs apt-get update and upgrade to utilize the screen.

a keyboard called florence (i think.... might be spelled differently.) works well customizable and can be hidden easily.

by installing xinput and using the commands i mentioned before you can make live changes to the touch screens behavior including the right click long press.

EDIT: changes made by using
Code: Select all
xinput set-prop
seem to only be temporary and will need ot be saved as mentioned above.
Posts: 6
Joined: Tue Mar 11, 2014 3:03 pm
by cpostier » Mon Jan 18, 2016 5:41 pm
Ugh, I'm chmod-ing that X11 directory but I cant write any file to it :( I am a bit new to this, tried to vi create the file, no luck either. using filezilla and ssh connect to it tried creating locally then drag it over... stubborn pi

Any suggestions?

UPDATE: I got it, sorry, sudo chmod 777 "X11"
Posts: 3
Joined: Fri Jan 15, 2016 3:32 am
by stutteringp0et » Thu Jan 21, 2016 6:33 am
I hate to be another "me too" - but it's still not working in Jesse
Posts: 12
Joined: Sun Oct 20, 2013 2:48 am
by AiGreek » Thu Jan 21, 2016 6:36 am
I use a touchscreen from chalk-elec.com and since the last rpi-update, the long press is working
User avatar
Posts: 229
Joined: Sun Dec 06, 2015 7:44 pm
by isntitknoying » Sun Jan 24, 2016 12:14 am
AiGreek wrote:I use a touchscreen from chalk-elec.com and since the last rpi-update, the long press is working


I have one of their touchscreens as well...do you use the same driver and matchproduct lines?
Posts: 1
Joined: Sun Jan 24, 2016 12:07 am
by DougieLawson » Sun Jan 24, 2016 4:16 pm
I added the config (from https://www.raspberrypi.org/forums/post ... 2#pr820611) as new file /usr/share/X11/xorg.conf.d/20-touchscreen.conf

/var/log/Xorg.0.log shows
Code: Select all
[    15.151] (II) Using input driver 'evdev' for 'FT5406 memory based driver'
[    15.152] (**) FT5406 memory based driver: always reports core events
[    15.152] (**) evdev: FT5406 memory based driver: Device: "/dev/input/event2"
[    15.152] (--) evdev: FT5406 memory based driver: Vendor 0 Product 0
[    15.152] (--) evdev: FT5406 memory based driver: Found absolute axes
[    15.152] (--) evdev: FT5406 memory based driver: Found absolute multitouch axes
[    15.152] (II) evdev: FT5406 memory based driver: No buttons found, faking one.
[    15.153] (--) evdev: FT5406 memory based driver: Found x and y absolute axes
[    15.153] (--) evdev: FT5406 memory based driver: Found absolute touchscreen
[    15.153] (II) evdev: FT5406 memory based driver: Configuring as touchscreen
[    15.153] (**) Option "EmulateThirdButton" "1"
[    15.153] (**) Option "EmulateThirdButtonTimeout" "750"
[    15.153] (**) Option "EmulateThirdButtonMoveThreshold" "30"
[    15.153] (**) evdev: FT5406 memory based driver: YAxisMapping: buttons 4 and 5
[    15.153] (**) evdev: FT5406 memory based driver: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
so it's been read.

xinput list-props 8 gets this
Code: Select all
Device 'FT5406 memory based driver':
        Device Enabled (116):   1
        Coordinate Transformation Matrix (117): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
        Device Accel Profile (244):     0
        Device Accel Constant Deceleration (245):       1.000000
        Device Accel Adaptive Deceleration (246):       1.000000
        Device Accel Velocity Scaling (247):    10.000000
        Device Product ID (237):        0, 0
        Device Node (238):      "/dev/input/event2"
        Evdev Axis Inversion (248):     0, 0
        Evdev Axis Calibration (249):   <no items>
        Evdev Axes Swap (250):  0
        Axis Labels (251):      "Abs MT Position X" (242), "Abs MT Position Y" (243), "None" (0), "None" (0)
        Button Labels (252):    "Button Unknown" (239), "Button Unknown" (239), "Button Unknown" (239), "Button Wheel Up" (122), "Button Wheel Down" (123)
        Evdev Scrolling Distance (253): 0, 0, 0
        Evdev Middle Button Emulation (254):    0
        Evdev Middle Button Timeout (255):      50
        Evdev Third Button Emulation (256):     1
        Evdev Third Button Emulation Timeout (257):     750
        Evdev Third Button Emulation Button (258):      3
        Evdev Third Button Emulation Threshold (259):   30
        Evdev Wheel Emulation (260):    0
        Evdev Wheel Emulation Axes (261):       0, 0, 4, 5
        Evdev Wheel Emulation Inertia (262):    10
        Evdev Wheel Emulation Timeout (263):    200
        Evdev Wheel Emulation Button (264):     4
        Evdev Drag Lock Buttons (265):  0


But I can't find any part of the GUI that I'd expect to react to a right click. But that may be simply because I so very rarely do anything with the GUI or I'm an idiot, or it doesn't work.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.
User avatar
Posts: 28145
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
by a human » Mon Feb 01, 2016 1:36 pm
Does this Work on the rasbian stretch beta?
Posts: 4
Joined: Sat Oct 31, 2015 5:45 pm