jweob
Posts: 31
Joined: Sun Jul 15, 2012 1:56 pm

Any way to disable click and drag on touchscreen?

Thu Mar 12, 2015 11:02 am

I have a sainsmart eGalax 7" touchscreen set up and calibrated on my Pi, which is running Raspbian. The Pi is acting as a control screen for a web application. I running kweb in kiosk mode to view the webpages. It works OK, but some clicks do not register, or are registered as click and drag rather than a single click.

I only need single left clicks for the web application. I'd like to disable click and drag and have the Pi interpret any click and release as a left click regardless of how far the cursor has moved. Is there any way of doing this? Also, are there any settings that can be adjusted to make the touchscreen more sensitive to clicks?

Thanks!

pinkstond
Posts: 6
Joined: Mon Sep 17, 2012 9:59 pm

Re: Any way to disable click and drag on touchscreen?

Tue Mar 17, 2015 4:41 pm

I'm interested in this as well. I am constantly having users accidentally drag when they are clicking. This causes unwanted highlighting and other problems.

jweob
Posts: 31
Joined: Sun Jul 15, 2012 1:56 pm

Re: Any way to disable click and drag on touchscreen?

Tue Mar 24, 2015 4:07 am

I found a partial solution that will at least stop text being inadvertently highlighted by the user if you are building a web app. You can add the following text to your CSS for body:

Code: Select all

-webkit-touch-callout: none;
-webkit-user-select: 
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
I got the code from this stack overflow answer: http://stackoverflow.com/questions/1319 ... text-table

jweob
Posts: 31
Joined: Sun Jul 15, 2012 1:56 pm

Re: Any way to disable click and drag on touchscreen?

Thu Apr 16, 2015 3:57 am

I found a solution to this http://stackoverflow.com/questions/7045 ... l-elements

You add the following properties to the body of the webpage

Code: Select all

<BODY ondragstart="return false;" ondrop="return false;">

jellium
Posts: 2
Joined: Mon Apr 25, 2016 3:32 pm

Re: Any way to disable click and drag on touchscreen?

Mon Apr 25, 2016 3:36 pm

Hi,

Is there a way to disable click and drag as a general setting (i.e. not only for some web applications)?
It would be great if I had to double-click & drag in order to reproduce the current behavior of a single click & drag. As such,, pressing the finger on the screen, followed by the motion of the finger on the screen would only move the cursor instead of dragging whatever was below the finger press.

Thanks!

jellium
Posts: 2
Joined: Mon Apr 25, 2016 3:32 pm

Re: Any way to disable click and drag on touchscreen?

Mon Jul 17, 2017 2:22 pm

Anyone has been able to find a solution for this issue (a way to interpret a touch on the screen as a single left click instead of a left click and then drag)?

Return to “Raspbian”