0

[SOLVED ! ] 3.5" PiTFT resistive Touchscreen - Right-click a
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

[SOLVED ! ] 3.5" PiTFT resistive Touchscreen - Right-click a

by adamaddin on Sun Jul 26, 2015 6:58 pm

Hello, I have an 3.5" PiTFT with resistive touchscreen installed on a RaspberryPi 2.
I use Raspbian and followed the Easy Install tutorial on the Ada site. Now everything works fine except two points that I do not get right:

1. How do I enable right- clicking on the Touchscreen?
Single and double left click with a stylus or fingernail work out-of-the-box, but I found no way to emulate a right click.
I searched the web for hours now, and found a lot, but nothing helpful yet. I found this documentation here
https://ssl.webpack.de/www.conan.de/tou ... touch.html
and tried to put these lines

Section "InputClass"
Identifier "Adafruit PiTFT"
Option "longtouch_action" "click"
Option "longtouch_button" 3
EndSection

in an extra xorg.conf file or to pack them into one of the existing .conf-files in /etc/X11/xorg.conf.d/ or /user/share/X11/xorg.conf.d/ - nothing worked.
In most cases the Raspi doesn't boot any more to X then.
What do I do wrong?

2.Several windows, e.g the openbox-configuration -manager, are so big that they dont fit on the screen, and also are not resizeable to a size that fits the screen.
So for example the "Cancel" and "apply"-Buttons in thes windows are not visible and not clickable.

Thanks for your help in advance,
Martin
Last edited by adamaddin on Tue Jul 28, 2015 7:10 am, edited 1 time in total.

adamaddin
 
Posts: 3
Joined: Sun Jul 26, 2015 6:21 pm

Re: 3.5" PiTFT resistive Touchscreen - Right-clicking and wi

by adafruit_support_rick on Mon Jul 27, 2015 10:53 am

The screen does not support multi-touch. Have you tried holding down the control or option key on the keyboard to get a right-click?

The screen is not resizeable. Some dialog boxes are too large to fit. That's just the way it is - there's no workaround.

adafruit_support_rick
 
Posts: 34320
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: 3.5" PiTFT resistive Touchscreen - Right-clicking and wi

by adamaddin on Mon Jul 27, 2015 4:18 pm

@ Rick,

thanks for your reply.
The issue with the windows too big for the screen seems to be a problem of Openbox we have to live with, choosing a smaller font helps only a little bit.

But I think you did get me wrong regarding my main problem, the missing right-click emulation:

it is not multitouch support that I am looking for.
As the PiTFT recognises both single and double left clicks, there has to be a location where things like e.g. the timer for the doubleclick are specified.
And I presume that in the same location somewhere under the hood of Raspbian it should be possible to specify the two options

>Option "longtouch_action" "click"
>Option "longtouch_button" 3

that are described in the evtouch driver documentation I mentioned.
Thats what I am looking for.
Or is it not evtouch that is used as a driver for the PiTFT in the customised Raspbian image?

Have you tried holding down the control or option key on the keyboard to get a right-click?

Of course I am able to right-click with an USB-keyboard connected, but having to use a keyboard or mouse alongside with the touchscreen doesn't make much sense to me - why should I use a touchscreen at all then?

Best regards,
Martin

adamaddin
 
Posts: 3
Joined: Sun Jul 26, 2015 6:21 pm

Re: 3.5" PiTFT resistive Touchscreen - Right-clicking and wi

by adafruit2 on Mon Jul 27, 2015 10:35 pm

hiya, we've never done any sort of right-click stuff so not sure how to get it working. you can see the driver for the touchscreen here
https://github.com/adafruit/adafruit-ra ... stmpe-ts.c
and you can see evtest output by running the code here
https://learn.adafruit.com/adafruit-pit ... alibration
let us know if you can get right-click working, that would be cool!

adafruit2
Site Admin
 
Posts: 14897
Joined: Fri Mar 11, 2005 7:36 pm

Re: 3.5" PiTFT resistive Touchscreen - Right-clicking and wi

by adamaddin on Tue Jul 28, 2015 5:32 am

SOLVED!

A few more hours of research on the net brought up the oh so simple solution, described here:

http://www.staff.amu.edu.pl/~kalmar/blog/?p=247

Just add the following lines at the end of /etc/X11/xorg.conf.d/99-calibration.conf

Code: Select all | TOGGLE FULL SIZE
   Option "EmulateThirdButton" "1"
   Option "EmulateThirdButtonTimeout" "750"
   Option "EmulateThirdButtonMoveThreshold" "30"

and voilà, a right mouse click is emulated when holding down the stylus for 750 ms.

So, the 99-configuration.conf on my RasPi now looks like this:

Code: Select all | TOGGLE FULL SIZE
Section "InputClass"
   Identifier      "calibration"
   MatchProduct    "stmpe-ts"
   Option  "Calibration"   "3800 120 200 3900"
   Option  "SwapAxes"      "1"
   Option "EmulateThirdButton" "1"
   Option "EmulateThirdButtonTimeout" "750"
   Option "EmulateThirdButtonMoveThreshold" "30"
EndSection

Documentation on these and other options can be found here:

http://www.dsm.fordham.edu/cgi-bin/man-cgi.pl?topic=evdev&ampsect=4

In combination with the florence virtual keyboard, no need for any bulky peripherals any more!

Would be a good idea to update the tutorials and Raspbian image on the adafruit page with this information, I think.

Cheers, Martin

adamaddin
 
Posts: 3
Joined: Sun Jul 26, 2015 6:21 pm

Re: [SOLVED ! ] 3.5" PiTFT resistive Touchscreen - Right-cli

by adafruit_support_rick on Tue Jul 28, 2015 9:48 am

Nice work! I added a link to your post to the FAQ section of the tutorial. I'm thinking it might belong in the Extras section, though. We'll have to work on that.

adafruit_support_rick
 
Posts: 34320
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: [SOLVED ! ] 3.5" PiTFT resistive Touchscreen - Right-cli

by iNC0GNi70 on Sat Dec 10, 2016 6:23 pm

Hello there !
Huuuh, well, sorry to bump that topic after so much time but... Huuuh, I followed the steps and the right click doesn't work...
I use a stylus, and even my fingernail but no right click menu shows up.
Also about the windows being too big, I bet it can be fixed by fixing a low DPI value, as the Raspberry pi seems to work with 90 dpi out of the box, although I'm a little bit confused of how to do so with the PiTFT screen.
EDIT :
So I created a new file in Xorg.conf.d that I named 99- font.conf, and inside I added
Code: Select all | TOGGLE FULL SIZE
Section "Files"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "/usr/share/fonts/X11/75dpi:unscaled:"
EndSection

And later added this line to my ~/.bashrc
Code: Select all | TOGGLE FULL SIZE
alias startx="startx -- -dpi 75"

And one line for my X login manager, it seems to work.
I'm now to find a way to change the system fixed font width.

iNC0GNi70
 
Posts: 3
Joined: Sat Dec 10, 2016 6:18 pm

Re: [SOLVED ! ] 3.5" PiTFT resistive Touchscreen - Right-cli

by adafruit_support_rick on Sun Dec 11, 2016 10:17 am

Possibly, there have been changes in the operating system since that was written?

adafruit_support_rick
 
Posts: 34320
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: [SOLVED ! ] 3.5" PiTFT resistive Touchscreen - Right-cli

by iNC0GNi70 on Sun Dec 11, 2016 5:23 pm

I guess, perhaps I missed one step ? As far as I'm aware it is just a trick into the screen's calibration file. Someone can make it work ? I use the latest PiTFT Raspbian system image from here.

iNC0GNi70
 
Posts: 3
Joined: Sat Dec 10, 2016 6:18 pm

Please be positive and constructive with your questions and comments.